• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Connection problem with oracle

 
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.
 
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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE 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?
 
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic