hello all, I have got a dreaded xception. Heres how it looks like: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114) oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156) oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269) oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:210) oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251) oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224) java.sql.DriverManager.getConnection(DriverManager.java:517) java.sql.DriverManager.getConnection(DriverManager.java:177) at tester.main(tester.java:44) All that I have in main is : Class.forName("oracle.jdbc.driver.OracleDriver"); OracleConnection conn1 = (OracleConnection)DriverManager.getConnection( "jdbc racle:thin:@<ipAddress>:1521:SIDA",usr1,pas1); System.out.println("conn1 made"); conn1.close(); OracleConnection conn2 = (OracleConnection)DriverManager.getConnection( "jdbc racle:thin:@<ipAddress>:1521:SIDB",usr2,pas2); System.out.println("conn2 made"); conn2.close(); there are 2 Oracle 8i databases on diff machines. I get conn1 but when i try to get conn2, the above exception occurs. I have tried with classes111.zip and classes12.zip but to no avail. I can get sql net and sqlplus connections to both the databases from my machine. but not via jdbc. also tried with jdbc-odbc connectivity, but still :-( any suggestions what might be wrong here? thanx
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
If they are on 2 different machines, where do you specify that in the URL?
Html ate up the ipAddress:-). heres how it should have looked like... All that I have in main is : Class.forName("oracle.jdbc.driver.OracleDriver"); OracleConnection conn1 = (OracleConnection)DriverManager.getConnection( "jdbcOracle:thin:@(ipAddress1):1521:SIDA", usr1,pas1); System.out.println("conn1 made"); conn1.close(); OracleConnection conn2 = (OracleConnection)DriverManager.getConnection( "jdbc racle:thin:@(ipAddress2):1521:SIDB", usr2,pas2); System.out.println("conn2 made"); conn2.close(); any suggestions???
Bhupinder Dhillon
Ranch Hand
Joined: Oct 12, 2000
Posts: 124
posted
0
I used to get this error too. Make sure SIDB is not an alias, Oracle driver doesn't like that. You have to provide the original SID.
[This message has been edited by Bhupinder Dhillon (edited March 13, 2001).]