萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> mysql教程 >> JDBC URL連接常用數據庫格式與驅動

JDBC URL連接常用數據庫格式與驅動

下面我們來看一篇關於JDBC URL連接常用數據庫格式與驅動例子,希望這篇教程能夠對各位帶來幫助,各位一起來看看吧。

MySQL
MySQL Connector/J Driver
驅動程序包名:MySQL-connector-Java-x.x.xx-bin.jar
驅動程序類名: com.mysql.jdbc.Driver
JDBC URL: jdbc:mysql://<host>:<port>/<database_name>
默認端口3306,如果服務器使用默認端口則port可以省略
MySQL Connector/J Driver 允許在URL中添加額外的連接屬性jdbc:mysql://<host>:<port>/<database_name>?property1=value1&property2=value2

PostgreSQL
PostgreSQL Native JDBC Driver
驅動程序包名:驅動程序類名: org.postgresql.Driver
JDBC URL: jdbc:postgresql://<host>:<port>/<database_name>
默認端口5432

Microsoft SQL Server
Microsoft SQL Server JDBC Driver (用來連接 SQLServer 2000)
驅動程序包名:msbase.jar mssqlserver.jar msutil.jar
驅動程序類名: com.microsoft.jdbc.sqlserver.SQLServerDriver
JDBC URL: jdbc:microsoft:sqlserver://<server_name>:<port>
默認端口1433,如果服務器使用默認端口則port可以省略

Microsoft SQL Server 2005 JDBC Driver(用來連接 SQLServer 2005以上版本)
驅動程序包名:sqljdbc.jar
驅動程序類名: com.microsoft.sqlserver.jdbc.SQLServerDriver
JDBC URL: jdbc:sqlserver://<server_name>:<port>
默認端口1433,如果服務器使用默認端口則port可以省略


Oracle
Oracle Thin JDBC Driver
驅動程序包名:ojdbc14.jar
驅動程序類名: oracle.jdbc.driver.OracleDriver
JDBC URL:
jdbc:oracle:thin:@//<host>:<port>/ServiceName

jdbc:oracle:thin:@<host>:<port>:<SID>

IBM DB2
IBM DB2 Universal Driver Type 4
驅動程序包名:db2jcc.jar db2jcc_license_cu.jar
驅動程序類名: com.ibm.db2.jcc.DB2Driver
JDBC URL: jdbc:db2://<host>[:<port>]/<database_name>

IBM DB2 Universal Driver Type 2

驅動程序包名:db2jcc.jar db2jcc_license_cu.jar
驅動程序類名: com.ibm.db2.jcc.DB2Driver
JDBC URL: jdbc:db2:<database_name>

Informix
Informix JDBC Driver
驅動程序包名:ifxjdbc.jar
驅動程序類名: com.informix.jdbc.IfxDriver
JDBC URL: jdbc:informix-sqli://{<ip-address>|<host-name>}:<port-number>[/<dbname>]: INFORMIXSERVER=<server-name>

Sybase
Sybase Adaptive Server Enterprise JDBC Driver
驅動程序包名:jconn2.jar 或jconn3.jar
驅動程序類名: com.sybase.jdbc2.jdbc.SybDriver (com.sybase.jdbc3.jdbc.SybDriver)
JDBC URL: jdbc:sybase:Tds:<host>:<port>默認端口5000

Sybase Adaptive Server Anywhere or Sybase IQ JDBC Driver
驅動程序包名:jconn2.jar 或jconn3.jar
驅動程序類名: com.sybase.jdbc2.jdbc.SybDriver (com.sybase.jdbc3.jdbc.SybDriver)
JDBC URL: jdbc:sybase:Tds:<host>:<port>?ServiceName=<database_name>
默認端口2638

Teradata
Teradata Driver for the JDBC Interface
驅動程序包名:terajdbc4.jar tdgssjava.jar gui.jar
驅動程序類名: com.ncr.teradata.TeraDriver
JDBC URL:
Type 4: jdbc:teradata://DatabaseServerName/Param1,Param2,…
Type 3: jdbc:teradata://GatewayServerName:PortNumber
/DatabaseServerName/Param1,Param2,…

Netezza
Netezza JDBC Driver
驅動程序包名:terajdbc4.jar tdgssjava.jar gui.jar
驅動程序類名: org.netezza.Driver
JDBC URL: jdbc:netezza://<host>:<port>/<database_name>

copyright © 萬盛學電腦網 all rights reserved