• 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

getconnection() --> SQLException

 
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have Oracle 8i personnal editon, jdk1.3, window98. I have installed the thin driver.
I tried to getconnection() it gives me error
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
My code

In the getconnection, we have to pass hostname, port# and sid.
I want to use oracle8i personnal edition, so I am using localhost, 1521 and ORCL. But I don't know what the SID is.
Thanks,
Vanitha.

[This message has been edited by Vanitha Sugumaran (edited October 29, 2001).]
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SID is the "host String" you pass to connect to your local oracle database usind SQL*Plus. Basically, It's the name of the database you want to connect to.
 
Vanitha Sugumaran
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply Sanjay. I am totally new to this subject. So kindly guide me through this.
I don't know how to find the SID. I am using oracle8i personnal edition.
When I use sqlplus, I am not entering anything in the hoststring option. It is working fine for me.
I need to connect jdbc to oracle here is where I am having trouble with SID.
Vanitha.
 
sanjay yermalkar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The default database name is the one you provided while installing oracle. You can get it from the file -
<oracle_home>\network\ADMIN\tnsnames.ORA
It should look like this:


Here, "RAM" is the name of the default database I entered while installing oracle.
I could access my personal oracle by having SID = RAM in my java program.
hope this helps!

[This message has been edited by sanjay yermalkar (edited October 29, 2001).]
 
Vanitha Sugumaran
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot sanjay!
Vanitha.
 
reply
    Bookmark Topic Watch Topic
  • New Topic