Jdbc url format customization and jdbcurl Customization

Source: Internet
Author: User
Tags sybase

Jdbc url format customization and jdbcurl Customization
Database URL formulation:

When the driver is loaded, you can establish a connection using the DriverManager. getConnection () method in the program. For reference, three overload DriverManager. getConnection () methods are listed:

  • GetConnection (String url)

  • GetConnection (String url, Properties prop)

  • GetConnection (String url, String user, String password)

Here, each form requires a database URL. The Database URL directs to the database address.

A database URL is mostly used to establish connections.

The following table lists the popular JDBC driver names and database URLs.

RDBMS JDBC driver name URL format
MySQL Com. mysql. jdbc. Driver Jdbc: mysql ://Hostname/databaseName
ORACLE Oracle. jdbc. driver. OracleDriver Jdbc: oracle: thin :@Hostname: port Number: databaseName
DB2 COM.ibm.db2.jdbc.net. DB2Driver Jdbc: db2:Hostname: port Number/databaseName
Sybase Com. sybase. jdbc. SybDriver Jdbc: sybase: Tds:Hostname: port Number/databaseName

All highlighted parts in URL format are static, and only the remaining parts need to be changed according to the database settings.

 

Source: http://www.yiibai.com/jdbc/jdbc-db-connections.html

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.