• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Network Adapter

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If they are on 2 different machines, where do you specify that in the URL?
 
Sachin Deshpande
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic