Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exception with DriverManager.getConnection to Oracle DB

Status
Not open for further replies.

celia05es

Programmer
Jan 10, 2002
81
US
Hello,
I am new to JDBC and I do hope you can help me.
I am only trying to connect to an ORACLE database but I get "E/S Exception: Connection refused"
I don't know if it is relevant but here is what I have:
- Jakarta-Tomcat 5.0.19
- j2sdk-1_4_0_02-solaris-sparc[1].tar.gz
- in my WEB-INF/lib I have, for the driver:
classes12.jar nls_charset12.jar

I am doing the following:
try
{
String JdbcDriver= "oracle.jdbc.driver.OracleDriver";
Class.forName(JdbcDriver).newInstance();
}
catch(Exception ex)
{
System.out.println("Can't find the driver");
}
try
{
System.out.println("Trying to connect...");
String JdbcURL=""jdbc:eek:racle:thin:aaa/aaa123@172.16.20.150:1521:siu";
conn=DriverManager.getConnection(JdbcURL);
connected=true;
}
catch (Exception e)
{
connected=false;
System.out.println("SQL Exception="+e.getMessage());
}

When executing the getConnection method, I get the following exception:
Connection refused(DESCRIPTION=(TMP=)(V
SNNUM=153092352)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))

Anyone can help me or at least give me a hint about where to look?

Thank you in advance.
 
Hi,

Are u able to connect to the Oracle DB from the SQLPlus ?

username:sui
password:
hoststring:aaa/aaa123@172.16.20.150

Just make sure your connectURL is correct.

Cheers
Venu
 
Problem solved. The database instance was incorrect. It was "nr" instead of "siu"!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top