Format one: Use ServiceName mode:
Jdbc:oracle:thin:@//Example Jdbc:oracle:thin:@//xxx.xxx.xxx.xxx:1526/cdev
After @ there is//, which is the main difference from using SIDS. (11g does not add after @//OK)
This format is the recommended format for Oracle.
Because the SID for each node is different for the cluster, the service name can contain all nodes.
Format two: Use SID mode:
Jdbc:oracle:thin:@Example Jdbc:oracle:thin: @xxx. Xxx.xxx.xxx:1526:cdev2
Format three: Use Tnsname way:
Jdbc:oracle:thin:@<tnsname>
Example Jdbc:oracle:thin: @CDEV
Note that Oracle supports tnsnames from 10.2.0.1
Database version |
Jdbc |
Support JDK |
Service_Name |
Sid |
8i |
Classes111.jar |
1.5 or 1.6 |
Not supported |
Support |
9i |
Classes12.jar |
1.5 or 1.6 |
Not supported |
Support |
10g |
Ojdbc14.jar |
1.5 or 1.6 |
Support |
Support |
11g |
Ojdbc5.jar |
1.5 |
Support |
Support |
Ojdbc6.jar |
1.6 |
Support |
Support |
Java Connection Oracle database uses service NAME, Sid, and Tnsname to use different notation