Microsoft SQL Server (6.5, 7, 2000 and 2005) and Sybase (10, 11, 12).
名称: jTDS
主页: http://jtds.sourceforge.net/
版本: 1.0.2
实例:
Class.forName("net.sourceforge.jtds.jdbc.Driver ");
String url = "jdbc:jtds:sqlserver://host:port/database";
Connection con = DriverManager.getConnection(url,"user","password");
or
Connection con = DriverManager.getConnection(url,"user","password");
Microsoft SQL Server 2000
名称: SQL Server 2000 Driver for JDBC
主页: http://www.microsoft.com/china/sql/
版本: (SQL Server 2000 Driver for JDBC)
实例:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
String url = "jdbc:microsoft:sqlserver://ip:1433";
Connection conn = DriverManager.getConnection (url,"user","password");
Oracle
名称: Connector/J
主页: http://www.oracle.com/technology/software/tech/java/
版本: (based on Oracle)
实例:
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@ip:port:databse";
Connection con = DriverManager.getConnection(url,"user","password");
MySQL
名称: Connector/J
主页: http://dev.mysql.com/
版本: 3.1
实例:
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://ip:port/database";
Connection con = DriverManager.getConnection(url,"user","password");
Sybase
名称: jConnect
主页: http://www.sybase.com.cn/cn/content/SDN/
版本: 4.5/5.5
实例:
Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();
String url = "jdbc:sybase:Tds:IP:2638?ServiceName="+database;
DriverManager.getConnection(url,"user","password");
Postgresql
名称: PostgreSQL JDBC
主页: http://jdbc.postgresql.org/
版本: 8.0 Build 310
实例:
Class.forName("org.postgresql.Driver");
String url ="jdbc:postgresql://host:port/database";
Connection con = DriverManager.getConnection(url,"user","password");
IBM Informix
名称: Informix JDBC Driver (IBM Informix JDBC V3.0)
主页: http://www-306.ibm.com/software/data/informix/
版本: 3.0.JC1
实例:
Class.forName("com.informix.jdbc.IfxDriver").newInstance();
String url = "jdbc:informix-sqli://ip:1533/myDB:INFORMIXSERVER=myserver;user=user;password=password";
Connection conn= DriverManager.getConnection(url);
IBM DB2
名称: DB2 JDBC Universal Driver
主页: http://www-306.ibm.com/software/data/db2/udb/
版本:
实例:
Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance();
String url = "jdbc:db2://ip:5000/database";
Connection conn= DriverManager.getConnection(url,user,password);
IBM AS400主机在用的JDBC语法
有装V4R4以上版本的Client Access Express
可以在C:\Program Files\IBM\Client Access\jt400\lib
找到 driver 档案 jt400.zip,并更改扩展名成为 jt400.jar
实例:
java.sql.DriverManager.registerDriver (new com.ibm.as400.access.AS400JDBCDriver ());
Class.forName("com.ibm.as400.access.AS400JDBCConnection");
con = DriverManager.getConnection("jdbc:as400://IP","user","password");
Ms Access or Ms Foxpro
实例:
step 1: 配置 odbc (例如:myDb)
step 2:
String url= "jdbc:odbc:myDb";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection(url);
or
String url = "jdbc:odbc:driver={MicrosoftAccessDriver(*.mdb)};DBQ=dabase.mdb";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection(url); |