Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getconnection() --> SQLException

 
Vanitha Sugumaran
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • 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).]
 
sanjay yermalkar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Thanks a lot sanjay!
Vanitha.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic