Common database driver and JDBC URL sharing _java programming

Source: Internet
Author: User
Tags odbc mysql database oracle database

Drivers and JDBC URLs for commonly used databases:

Oracle Database:

Driver Package Name: Ojdbc14.jar

Name of the driver class: Oracle.jdbc.driver.OracleDriver

JDBC url:jdbc:oracle:thin:@ Dbip:port:databasename

Description: Driver package name may be changed

The black font part of the JDBC URL must be preserved intact for the URL format that the driver recognizes. The red font part needs to be filled in according to the database installation. The meaning of each part is as follows:

dbip– is the IP address of the database server, if it is locally writable: localhost or 127.0.0.1.

port– is the listener port for the database, which needs to be configured at installation time by default of 1521.

databasename– is the SID of the database, typically the name of the global database.

For example, if you want to access the local database allandb, Port 1521, then the URL is written as follows:

Jdbc:oracle:thin: @localhost: 1521:allandb download address is as follows:

Http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html


SQL Server Database

Driver package Name: Msbase.jar Mssqlserver.jar Msutil.jar

Name of the driver class: Com.microsoft.jdbc.sqlserver.SQLServerDriver

JDBC url:jdbc:microsoft:sqlserver://Dbip:port;databasename=databasename

Description: Driver package name may be changed

The black font part of the JDBC URL must be preserved intact for the URL format that the driver recognizes. The Red font section needs to be filled in according to the database installation. The meaning of each part is as follows:

dbip– is the IP address of the database server, if it is locally writable: localhost or 127.0.0.1.

port– is the listener port for the database, which needs to be configured at installation time by default of 1433.

databasename– the name of the database.

For example, if you want to access the local database allandb, port 1433, then the URL is written as follows:

Jdbc:microsoft:sqlserver: @localhost: 1433; DatabaseName =allandb

Download Address: http://www.microsoft.com/downloads/details.aspx


MySQL Database

Driver Package Name: Mysql-connector-java-3.1.11-bin.jar

Name of the driver class: Com.mysql.jdbc.Driver

JDBC url:jdbc:mysql://Dbip:port/databasename

Description: Driver package name may be changed

The black font part of the JDBC URL must be preserved intact for the URL format that the driver recognizes. The Red font section needs to be filled in according to the database installation. The meaning of each part is as follows:

dbip– is the IP address of the database server, if it is locally writable: localhost or 127.0.0.1.

port– is the listener port for the database, which needs to be configured at installation time by default of 3306.

databasename– the name of the database.

For example, if you want to access the local database allandb, port 1433, then the URL is written as follows:

Jdbc:mysql://localhost:3306/allandb

Download Address: http://dev.mysql.com/downloads/connector/j/

Access Database

Driver package Name: The driver is included in the Javase and does not require additional installation.

Name of the driver class: Sun.jdbc.odbc.JdbcOdbcDriver

JDBC URL:jdbc:odbc:datasourcename

Description: This driver can only work in Windows system, first need to establish an Access database in the operating system of the local Data source (ODBC), if the name is Allandb, then the URL is written as follows:

Jdbc:odbc:allandb

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.