Search code examples
oracle-databasejdbcoracle11g

JDBC Thin connection string in Oracle uses both colon and forward slash


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 .


Solution

  • I've used both colon : and forward slash / for SID in connection URL and was able get the connection established. I think in Oracle 11g to connect with a Service Name, we can only use the forward slash / .