Oracle JDBC Thin String Uses Both Colon and Slash

I wanted to know if we can use the colon and slash with SID when creating the connection url in Oracle?

eg.

jdbc:oracle:thin:@<host>:1521:<SID> jdbc:oracle:thin:@<host>:1521/<SID> 

Will these two be the same and work?

I am creating an application that will work with both Oracle RAC and non-RAC environments, and RAC environments support the SERVICE NAME forward slash , so you will need to check non RAC support for the forward slash environment.

For RAC environment URL is as follows

 jdbc:oracle:thin:@<host>:1521/<SERVICENAME> 

Update This is another question because I want to ask whether it is possible to use both ( : and / when using <SID> in the connection string, which we call OracleJDBCUrl .

+1
oracle oracle11g jdbc
May 10 '17 at 5:52 a.m.
source share
2 answers

I managed to use a colon : and a slash / for the SID in the connection URL and was able to establish the connection. I think that in Oracle 11g we can do such a thing, and for the Service Name we can only use the slash / .

0
May 12 '17 at 6:55 a.m.
source share

We recommend that you use the long form of the connection URL as shown below.

: JDBC Oracle: thin: @ (DESCRIPTION = (ADDRESS = (HOST = MyHost) (PORT = 1521) (PROTOCOL = TCP)) (CONNECT_DATA = (SERVICE_NAME = myorcldbservicename)))

Check DataSourceSample and UCPSample for reference.

0
May 10 '17 at 17:29
source share



All Articles