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!