I wanted to know can we use both colon and forward slash with SID in making the connection URL in Oracle?
e.g.
jdbc:oracle:thin:@<host>:1521:<SID>
jdbc:oracle:thin:@<host>:1521/<SID>
Will these two are same and will work?
I am building an application which will work with both Oracle RAC and non RAC environments and RAC environments supports SERVICE NAME with forward slash
so wanted to check will non RAC
environment support forward slash
.
For RAC
environment URL is like this
jdbc:oracle:thin:@<host>:1521/<SERVICENAME>
Update
This is different question because i want to ask is it possible to use both (:
and /
while using <SID>
in the connection String which we call as OracleJDBCUrl
.
I was able to use both colon :
and forward slash /
for SID in connection URL
and was able get the connection established.
I think in Oracle 11g
we can do such thing and for Service Name
only we can use is forward slash /
.
We recommend to use the long form of the connection URL as show below.
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST=myhost)(PORT=1521)(PROTOCOL=tcp))(CONNECT_DATA=(SERVICE_NAME=myorcldbservicename)))
Check out DataSourceSample and UCPSample for reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With