wood burning stoves 2.0*
The moose likes JDBC and the fly likes excepttion in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "excepttion in thread "main" java.sql.SQLException: Io exception: The Network Adapter" Watch "excepttion in thread "main" java.sql.SQLException: Io exception: The Network Adapter" New topic
Author

excepttion in thread "main" java.sql.SQLException: Io exception: The Network Adapter

Ryan G Johnson
Ranch Hand

Joined: Nov 11, 2004
Posts: 33
know this has been posted repeatedly. However, I have tried all the generic solutions Mine is a little different.

1. I can connect with SQLPLUS to the database. I am on windows XP connecting to Oracle 10g on a Solaris box. So the listener is running.

2. Here is my tnsnames.ora entry which works with SQLPLUS:
I can tnsping this address





I am trying to run the following sample code:



I also used the following IP
Ryan G Johnson
Ranch Hand

Joined: Nov 11, 2004
Posts: 33
I also use the following:

David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Have you grabbed the latest driver from Oracle? Just to be sure, I'd also double check to make sure the orrect driver jar was being used.
Ryan G Johnson
Ranch Hand

Joined: Nov 11, 2004
Posts: 33
i am using the same driver as other people i work with who can connect.
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
Oracle service names and SIDs aren't the same thing. I wonder if the problem may be related to that? Your tnsnames entry describes the value as a service name, but in the oracle-style connection structure you say it is a SID. If you know the listener uses the same value for both SID and service name obviously it shouldn't matter, but if they differ, I suspect that is what you may be tripping over. You should only need to use the simpler form, the URL-based on, in any case. For 10g I'm pretty sure you specify the service name in the URL, not the SID, if you find the listener values differ.


Reid - SCJP2 (April 2002)
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
Originally posted by Reid M. Pinchback:
Oracle service names and SIDs aren't the same thing.

What Reid said...

If you're using a service name, the URL syntax changes; the port is seperated from the service name by a "/".

Try:

See:
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#05_04
 
Consider Paul's rocket mass heater.
 
subject: excepttion in thread "main" java.sql.SQLException: Io exception: The Network Adapter