• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting "The exception raised is:java.sql.SQLException: Io exception: The Network Adapter could not

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
The below is my code. I wanted to connect to Employee table from Oracle.

I am always getting the error as "The exception raised is:java.sql.SQLException: Io exception: The Network Adapter could not establish the connection"

I tried turning off the firewall, but no luck. Could someone please help me in resolving the issue.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have Oracle running on your own machine? Or did you forget to modify the hostname part of the JDBC URL?
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, is the server actually listening on tcp port 1521?

Note on "registerDriver". This is an obscure variant of the obsolete Class.forName() mechanism which has been unnecessary for many, many years now. All JDBC drivers within the last decade or so self-register automatically.

Oracle's docs apparently need some housecleaning. The top Google hit on "registerDriver" was for Oracle 11 and it also says:

Oracle 11g Java Documentation wrote:
However, this method is valid only for JDK-compliant Java virtual machines. It is not valid for Microsoft Java virtual machines.



Right there you know something is wrong. Microsoft hasn't been producing Java Virtual Machines since before Oracle bought Sun. Specifically since Microsoft tried to hijack Java, got sued, and lost.
 
Vijaya Parvathaneni
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The local Oracle stopped working suddenly. Due to which the issue happened. Now its working fine after starting the Oracle Services. Thanks for your responses.
 
reply
    Bookmark Topic Watch Topic
  • New Topic