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 |