P
prakash.mirji
Hello All,
i am using oracle.jdbc.driver.OracleDriver driver to connect to oracle
database.
And below is my tnsnames.ora file
ora2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(Host = oracleHost)(Port = 1521))
)
(CONNECT_DATA = (SID = ora1))
)
And in below line code of i use the instance name as ora1, my
connection will establish and i get the required output. However if i
use instance name as ora2 , i get SQL exception which says connection
didn't establish.
// Get a connection to the database
Connection conn =
DriverManager.getConnection( "jdbcracle:thinoracleHost.xyz.com:
1521:" + "ora2", "user", "passwd") ;
I can't change ora2 as ora1 because the there are multiple entries in
the tnsnames.ora file which uses SID and outside block name same as
ora1 but its on different oracle host.
My question is :
for jdbc connection , i should use SID as ora1?. Please let me know.
Thanks & Regards,
Prakash
i am using oracle.jdbc.driver.OracleDriver driver to connect to oracle
database.
And below is my tnsnames.ora file
ora2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(Host = oracleHost)(Port = 1521))
)
(CONNECT_DATA = (SID = ora1))
)
And in below line code of i use the instance name as ora1, my
connection will establish and i get the required output. However if i
use instance name as ora2 , i get SQL exception which says connection
didn't establish.
// Get a connection to the database
Connection conn =
DriverManager.getConnection( "jdbcracle:thinoracleHost.xyz.com:
1521:" + "ora2", "user", "passwd") ;
I can't change ora2 as ora1 because the there are multiple entries in
the tnsnames.ora file which uses SID and outside block name same as
ora1 but its on different oracle host.
My question is :
for jdbc connection , i should use SID as ora1?. Please let me know.
Thanks & Regards,
Prakash