• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Connection problem with oracle

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to connect to oracle 10 g databas on my local system. operating system is vista. A using netbeans IDE



I checked tha database name using the following query:

SQL> select name from v$database;

NAME
---------
ORCL

this shows that i am using the correct sid in url.
also the user name and password are correct.

But the error says:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection


can some one help me onthis.
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Deepak,

Just try out giving the IP address in place of "localhost" in the URL...

Also try out
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
instead of Class.forName()...

Regards,
Kiran.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Also try out
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
instead of Class.forName()...


This is generally a bad idea. It ties your implementation to an oracle database. You should only need to explicitly refer to the Oracle driver if you are planning to use some of its proprietory functionality. You also know the driver being registered is not the issue, because if the DriverManager could not find a driver to service the url you provide it would tell you.

Vista, unlike previous Microsoft OSs, comes with a firewall which is by default turned on. You might want to check this is not what is blocking your connection.

Cna you connect via SQLPlus? Can you connect with any of the other developer tools provided with your install?
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic