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

Jdbc url

 
vivek ja
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following line of code.

"jdbc racle:thin:@" + serverName + ":" + portNumber + ":" + serverInstance

Can someone tell me what I should give in the serverInstance.
Name of the server I have given in serverName

When i run this code am getting the following error
"Io exception: The Network Adapter could not establish the connection"

Thank you:-)

[Bear edit: not so urgent]
[ February 24, 2005: Message edited by: Bear Bibeault ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vivek,
Welcome to JavaRanch!

In Oracle, the server instances is the "oracle sid". This is also known as the name of your database.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't look like you're getting that far though. The driver needs to connect to the database before checking the SID, and your error looks like you're not connecting to the database.
 
Hareesh Ram Chanchali
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should give there the SID
If you are not able to know the SID
May be following help you

I think you know the host string which you will give while you connect to the oracle client.
Take that host id and with that you can get SID
go to the path
D:\oracle\ora92\network\admin (here it is D ..may be C ..or other drive)
here you will find tnsnames.ora file

there so many entries will be there
There u select an entry which starts with your host string
That entry will be like this

Host_string=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = some_address)(PORT = some_number))
)
(CONNECT_DATA =
(SERVICE_NAME = some_string)
)
)

You take that some_string which is SERVICE_NAME and keep there as SID

Hope this will work

Please send me the reply
others! please verify this
 
vivek ja
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Hareesh, I got it!
Thanks guys, its working now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic