Home JDBC各大数据库的连接字符串和驱动类
Post
Cancel

JDBC各大数据库的连接字符串和驱动类

Oracle

1
2
driverClass:oracle.jdbc.OracleDriver
url:jdbc:oracle:thin:@localhost:1521:dbname

MySQL

1
2
3
driverClass:com.mysql.jdbc.Driver
url:jdbc:mysql://localhost:3306/test?characterEncoding=utf8&useSSL=true 
// 注意: 高版本的MySQL需要显示指定useSSL

DB2

1
2
driverClass:com.ibm.db2.jcc.DB2Driver
url:jdbc:db2://localhost:50000/dbname

Sybase

1
2
driverClass:com.sybase.jdbc.SybDriver
url:jdbc:sybase:Tds:localhost:5007/dbname

PostgreSQL

1
2
driverClass:org.postgresql.Driver
url:jdbc:postgresql://localhost/dbname

SQLServer

1
2
driverClass:com.microsoft.sqlserver.jdbc.SQLServerDriver
url:jdbc:sqlserver://localhost:1433; DatabaseName=dbname
This post is licensed under CC BY 4.0 by the author.