java.sql.SQLException: Io exception: Connection Refused
843854Jul 4 2004 — edited Mar 18 2008Hi,
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