Java Connection Oracle database uses service NAME, Sid, and Tnsname to use different notation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.