MAVEN + Database Connectivity Driverclass, Jdbcurl, maven dependencies incomplete records __ Database

Source: Internet
Author: User
Tags db2 informix odbc postgresql sqlite sybase

Drive Jar Package Capture method:

1) automatically obtained through Maven;

2 to the Maven warehouse to search for downloads: http://search.maven.org/

3) to the database to download the official website.

MySQL driver source download: http://repo1.maven.org/maven2/mysql/mysql-connector-Java/5.1.25/src/

Db DRIVERCLASS/JDBCURL/JDBC Download Maven Dependency
Oracle Oracle.jdbc.driver.OracleDriver

<dependency>

<groupid>com. Oracle</groupid>

<artifactId>ojdbc14</artifactId>

<version>10.2.0.4.0</version>

</dependency>

Thin Mode:

Jdbc:oracle:thin: @host:p ort1521default:dbname

Mysql

Com.mysql.jdbc.Driver

Or

Org.gjt.mm.mysql.Driver

<dependency>

<groupId>mysql</groupId>

<artifactId>mysql-connector-java</artifactId>

<version>5.1.13</version>

</dependency>

Jdbc:mysql://host:port3306default/dbname?
user=username&password= password&useunicode=true&characterencoding=gb2312
Sybase

Com.sybase.jdbc3.jdbc.SybDriver

Or

Com.sysbase.jdbc.SybDriver

Jdbc:sybase:tds:host:port5007default/dbname
DB2

Com.ibm.db2.jdbc.NET.DB2Driver (Db2java.zip)

Or

Com.ibm.db2.jcc.DB2Driver (Db2jcc.jar)

Or

Com.ibm.db2.jdbc.app.DB2Driver

Use Db2jcc.jar:

<dependency>

<groupId>db2jcc</groupId>

<artifactId>db2jcc</artifactId>

<version>9.0</version>

</dependency>

<dependency>

<groupId>db2jcc_license_cu</groupId>

<artifactId>db2jcc_license_cu</artifactId>

<version>9.0</version>

</dependency>

Note: There is no such driver in the Maven warehouse, and you need to manually add the jar to the warehouse first.

Jdbc:db2://host:port5000default/dbname
About DB2 JDBC Driver
Informix Com.informix.jdbc.IfxDriver
jdbc:informix-sqli://host:port1533default/
Dbname:informixserver=server;user=username
;p Assword=password
SQL Server

2005 version and later:

Com.microsoft.sqlserver.jdbc.SQLServerDriver

Or

2000 Version:

Com.microsoft.jdbc.sqlserver.SQLServerDriver

<dependency>

<groupId>net.sourceforge.jtds</groupId>

<artifactId>jtds</artifactId>

<version>1.2.4</version>

</dependency>

Jdbc:sqlserver://host:port1433default;
Databasename=dbname
Access Sun.jdbc.odbc.JdbcOdbcDriver
Jdbc:odbc:dataSourceName
PostgreSQL Org.postgresql.Driver

<dependency>

<groupId>postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>9.1-901.jdbc3</version>

</dependency>

Or

<dependency>

<groupId>postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>9.1-901.jdbc4</version>

</dependency>

Version Optional Value:

<version>8.4-702.jdbc3</version>

Note:

JDBC3 is applicable to JDK1.5 and below;

JDBC4 is applicable to JDK1.6 and above.

Jdbc:postgresql://host:port5432default/dbname
Http://jdbc.postgresql.org/download.html
Sqlite Org.sqlite.JDBC

<dependency>

<groupId>org.xerial</groupId>

<artifactId>sqlite-jdbc</artifactId>

<version>3.7.2</version> </dependency>

Jdbc:sqlite:dbPath.db
http://www.xerial.org/maven/repository/
Artifact/org/xerial/sqlite-jdbc/3.7.2/
Derby

Org.apache.derby.jdbc.ClientDriver

Or

Org.apache.derby.jdbc.EmbeddedDriver

<dependency>

<groupId>org.apache.derby</groupId>

<artifactId>derby</artifactId>

<version>10.9.1.0</version>

</dependency>

Client mode:

Jdbc:derby://localhost:port1527default/dbname

HSQLDB

Org.hsqldb.jdbcDriver

 

or

 

Org. Hsqldb.jdbc.JDBCDriver

2.0 Previous version:

<dependency>

<groupId> hsqldb</groupid>

<artifactId>hsqldb</artifactId>

<version>1.8.0.7</ version>

</dependency>

 

2.0 and later:

<dependency>

<groupId>org.hsqldb</groupId>

<artifactId>hsqldb</artifactId>

< Version>2.2.8</version>

<!--JDK1.6 Environment eliminates the need to specify classifier-->

<classifier>jdk5</ classifier>

</dependency>

mem Mode:

Jdbc:hsqldb:mem:dbName

file Mode:

Jdbc:hsqldb:file:dbPath

res mode:

Jdbc:hsqldb:res:org.my.path.resdb

Connect to local hsql Server:

Jdbc:hsqldb:hsql://localhost/dbname

connect to local HTTP Server:

Jdbc:hsqldb:http://localhost/dbname

H2 Org.h2.Driver

<dependency>

<groupId>com.h2database</groupId>

<artifactId>h2</artifactId>

<version>1.3.168</version>

</dependency>

mem Mode:

Jdbc:h2:mem:dbName

connect to local TCP Server:

Jdbc:h2:tcp://localhost/~/dbname

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.