Detailed description of the writing and summary of the database connection URL, detailed description of the Database Connection url

Source: Internet
Author: User

Detailed description of the writing and summary of the database connection URL, detailed description of the Database Connection url

Detailed description of database connection URL writing and summary

Jdbc url = protocol name + sub-protocol name + Data Source Name.

A. The protocol name is always "jdbc ".
B. The sub-protocol name is determined by the JDBC driver writer.
C. The data source name may also contain user and password information, which can be provided separately.

Several common database connections

1-oracle-

Driver: Oracle. jdbc. driver. OracleDriver
URL: jdbc: oracle: thin: @ machine_name: port: dbname
Note: machine_name: name of the machine where the database is located;
Port: port number. The default value is 1521.

2-mysql-

Driver: com. MySQL. jdbc. Driver
URL: jdbc: mysql: // machine_name: port/dbname
Note: machine_name: name of the machine where the database is located;
Port: port number. The default value is 3306.

3-SQL Server-

Driver: com. microsoft. jdbc. sqlserver. SQLServerDriver
URL: jdbc: microsoft: sqlserver: // <machine_name> <: port>; DatabaseName = <dbname>
Note: machine_name: name of the machine where the database is located;
Port: port number. The default value is 1433.

4-DB2-

Driver: com. ibm. db2.jdbc. app. DB2Driver
URL: jdbc: db2: // <machine_name> <: port>/dbname
Note: machine_name: name of the machine where the database is located;
Port: port number. The default value is 5000.

The above is a detailed description of the writing and summary of the URL of the database connection. If you have any questions, please leave a message or go to the community on this site for discussion. Thank you for reading this article and hope to help you, thank you for your support!

Related Article

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.