File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ryan G Johnson
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also use the following:

 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using the same driver as other people i work with who can connect.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
stu derby
Ranch Hand
Posts: 333
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic