Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.sql.SQLException: Io exception: Connection Refused

843854Jul 4 2004 — edited Mar 18 2008
Hi,

Got struck in this since yesterday. I am trying to connect to an Oracle server and the code is pretty much simple and am reproducing the relevant portion here.

Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = null;
try {
conn = DriverManager.getConnection("jdbc:oracle:thin:@host_IP:1521:****","****","****");
} catch(Exception e) { System.out.println(e); }
conn.setAutoCommit(true);
Statement s = conn.createStatement();
ResultSet rs;

It gives me the following exception.
>>
java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=135294976)(ERR=12500)(ERROR_STACK=(ERROR=(CODE=12500)(EMFI=4))(ERROR=(CODE=12560)(EMFI=4))(ERROR=(CODE=530)(EMFI=4))(ERROR=(BUF='32-bit Windows Error: 2: No such file or directory'))))
Exception in thread "main" java.lang.NullPointerException
at Test.main(Test.java:17)
<<

The line 17 is actually the statement,
conn.setAutoCommit(true);

Any help is highly appreciated.

Thanks,
Baskaran
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 15 2008
Added on Jul 4 2004
2 comments
745 views