Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection problem with oracle

 
deepak buddineni
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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.
 
K Kiran Kumar
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic