aspose file tools*
The moose likes JDBC and the fly likes Network Adapter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Network Adapter" Watch "Network Adapter" New topic
Author

Network Adapter

Sachin Deshpande
Greenhorn

Joined: Jan 31, 2001
Posts: 25
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
If they are on 2 different machines, where do you specify that in the URL?


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Sachin Deshpande
Greenhorn

Joined: Jan 31, 2001
Posts: 25
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
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).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Network Adapter
 
Similar Threads
JDBC- ORACLE
JDBC- ORACLE
Oracle 8i thin Driver problem
Connect to Oracle via JDBC using JSP..
thin driver connection problem @thin: