Forums Register Login

Jdbc url

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
Vivek,
Welcome to JavaRanch!

In Oracle, the server instances is the "oracle sid". This is also known as the name of your database.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Hey Hareesh, I got it!
Thanks guys, its working now.
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 733 times.
Similar Threads
JBOSS keeps creating the UDP socket connections without closing it
Connect Java to SQL Server database -- com.microsoft.sqlserver.jdbc.SQLServerException: Login failed
WLST command for weblogic shutdown
problem in connecting to oracle through jdbc
Connection Pool in WebSphere
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:31:30.