Connection refused



Hello,

I hope someone can help. Please let me know if this is the wrong group
for my question.

I am new to java, jsp and oracle, so I ask that you please be patient.
I am attempting to create a context-param in web.xml for my connection
string, so that when I need to change the string I will only need to do
it in one place instead of 10+ files. When I perform a pooled
connection from within my code, the connection works correctly. For
example:

.....
PooledConnection conn = null;
Connection conn2 = null;
try
{
OracleConnectionPoolDataSource ocpds= new
OracleConnectionPoolDataSource();
ocpds.setURL("jdbc:oracle:thin:@<myservername>:1526:ORCL");
ocpds.setUser("user");
ocpds.setPassword("pass");

conn = ocpds.getPooledConnection();
conn2 = conn.getConnection();
......

However, I receive an error message when I try to access my connection
string from the web.xml. Here is my code within my web.xml:

.....
<context-param>
<param-name>dbConnectionString</param-name>

<param-value>"jdbc:oracle:thin:@<myservername>:1526:ORCL"</param-value>
</context-param>
<context-param>
<param-name>databaseUser</param-name>
<param-value>"user"</param-value>
</context-param>
<context-param>
<param-name>databasePassword</param-name>
<param-value>"pass"</param-value>
</context-param>
.....

Here is how I am calling the connection string from the web.xml into my
file:

.....
PooledConnection conn = null;
Connection conn2 = null;
try
{
OracleConnectionPoolDataSource ocpds= new
OracleConnectionPoolDataSource();
String dbConnectionString =
getServletContext().getInitParameter("dbConnectionString");
String databaseUser =
getServletContext().getInitParameter("databaseUser");
String databasePassword =
getServletContext().getInitParameter("databasePassword");

ocpds.setURL(dbConnectionString);
ocpds.setUser(databaseUser);
ocpds.setPassword(databasePassword);

conn = ocpds.getPooledConnection();
conn2 = conn.getConnection();
.....

The error I receive is:

SQLException: Io exception: Connection
refused(DESCRIPTION=(TMP=)(VSNNUM=168821504)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))

I have tried changing <myservername> to the ip address, but I get the
same error.

If anyone has any idea how to make this work, or if you need more
information, please let me know.

Thanks in advance,
Monica

.



Relevant Pages

  • Re: Nochmals Treeview
    ... private void button1_Click(object sender, System.EventArgs e) { ... private void TabelleAnlegen(string strDBPfad, string strDB, string strTabellenName){ ... OleDbConnection connection = new OleDbConnection; ... OleDbCommand command = new OleDbCommand; ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: ExecuteReader requires an open and available Connection.
    ... you have ALL your users sharing one connection. ... Public Shared Function GetServerAs String ... Dim theServer As String ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Error using Login control ASP.NET App_Data Folder
    ... the UserInstance type of connection string is for SQLEXPRESS only and is ... Server Management Studio and use a standard connection ... An error has occurred while establishing a connection to the server. ... SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Change Connection String during runtime
    ... connection is stored in the app.config file. ... connection string without exiting the application. ... Dim newConnection As String ... Private Sub RecordDatabase_Enter(ByVal sender As Object, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: OLE DB connection string in SharePoint for Sybase ASA
    ... > odbc in that SharePoint connection string setting? ... Each DBMS has its own proprietary set of Connection String ... Kevin Spencer ... >>> Server Error: An error occurred while retrieving the list of Databases ...
    (microsoft.public.frontpage.client)