下载JDBC驱动的资源

下载JDBC驱动的资源

在使用JDBC连接数据库的时候,一般都要求有相应数据库的JDBC驱动程序,(这里是针对TYPE4的JDBC连接而言的,具体有关TYPE4是什么,可以参考另外一篇文章http://apollosysu.bokee.com/5408156.html),这些数据库的JDBC驱动程序一般都是数据库厂商开发的,但是有些,例如MS之类的很久都,没有为它的SQL Server开发相应的JDBC驱程,所以要使用第三方公司开发的驱动程序(不过现在微软已经为SQL Server开发了JDBC驱动程序,呵呵),为了使得大家方便学习,这里给出一些主要的数据库相应的JDBC驱动下载地址和相应的操作方法,希望能够对大家有所帮助。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DbName:MicrosoftSQLServer(6.5,7,2000and2005)andSybase(10,11,12).
JDBCName:jTDS
HomePage:http://jtds.sourceforge.net/
JDBCVer:1.0.2
Download: http://sourceforge.net/project/showfiles.php?group_id=33291

ConnCode:
Class.forName("net.sourceforge.jtds.jdbc.Driver");
Connectioncon=DriverManager.getConnection("jdbc:jtds:sqlserver://host:port/database","user","password");
or
Connectioncon=DriverManager.getConnection("jdbc:jtds:sybase://host:port/database","user","password");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DbName:MicrosoftSQLServer2000
JDBCName:SQLServer2000DriverforJDBC
HomePage:http://www.microsoft.com/china/sql/
JDBCVer:(SQLServer2000DriverforJDBC)
Download:http://www.microsoft.com/china/sql/downloads/2000/jdbc.asp
ConnCode:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connectionconn=DriverManager.getConnection("jdbc:microsoft:sqlserver://server1:1433","user","password");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DbName:oracle
JDBCName:Connector/J
HomePage:http://www.oracle.com/technology/software/tech/java/
JDBCVer:(basedonoracle)
Download:http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/
ConnCode:
Class.forName("oracle.jdbc.driver.OracleDriver");
Connectioncon=DriverManager.getConnection("jdbc:oracle:thin:@host:port:databse","user","password");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DbName:MySQL
JDBCName:Connector/J
HomePage:http://dev.mysql.com/
JDBCVer:3.1
Download:http://dev.mysql.com/downloads/
ConnCode:
Class.forName("com.mysql.jdbc.Driver");
Connectioncon=DriverManager.getConnection("jdbc:mysql://host:port/database","user","password");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DbName:Sybase
JDBCName:jConnect
HomePage:http://www.sybase.com.cn/cn/content/SDN/
JDBCVer:4.5/5.5
Download:http://www.sybase.com/detail_list?id=13&morenavId=8668&multi=true&SR=Y&show=1265
ConnCode:
Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();
DriverManager.getConnection("jdbc:sybase:Tds:IP:2638?ServiceName="+database,"user","password");~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DbName:Postgresql

JDBCName:PostgreSQLJDBC
HomePage:http://jdbc.postgresql.org/
JDBCVer:8.0Build310
Download:http://jdbc.postgresql.org/download.html
ConnCode:
Class.forName("org.postgresql.Driver");
Connectioncon=DriverManager.getConnection("jdbc:postgresql://host:port/database","user","password");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DbName:IBMInformix
JDBCName:InformixJDBCDriver(IBMInformixJDBCV3.0)
HomePage:http://www-306.ibm.com/software/data/informix/
JDBCVer:3.0.JC1
Download:http://www14.software.ibm.com/webapp/download/search.jsp?go=y&rs=ifxjdbc
ConnCode:
Class.forName("com.informix.jdbc.IfxDriver").newInstance();
Connectionconn=DriverManager.getConnection("jdbc:informix-sqli://123.45.67.89:1533/myDB:INFORMIXSERVER=myserver;user=testuser;password=testpassword";);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DbName:IBMDB2
JDBCName:DB2JDBCUniversalDriver
HomePage:http://www-306.ibm.com/software/data/db2/udb/
JDBCVer:
Download:http://www-128.ibm.com/developerworks/db2/downloads/jcc/
ConnCode:
Class.forName("com.ibm.db2.jdbc.app.DB2Driver").newInstance();
Connectionconn=DriverManager.getConnection("jdbc:db2://localhost:5000/sample",user,password);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

IBMAS400主机在用的JDBC语法
有装V4R4以上版本的ClientAccessExpress
可以在C:/ProgramFiles/IBM/ClientAccess/jt400/lib
找到driver档案jt400.zip,并更改扩展名成为jt400.jar
ConnCode:
java.sql.DriverManager.registerDriver(newcom.ibm.as400.access.AS400JDBCDriver());
Class.forName("com.ibm.as400.access.AS400JDBCConnection");
con=DriverManager.getConnection("jdbc:as400://IP","user","password");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DbName:MsAccessorMsFoxpro
ConnCode:
step1:
配置odbc(例如:myDb)
step2:
StringdbURL="jdbc:odbc:myDb";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connectionconn=DriverManager.getConnection(dbURL);
or
StringdbURL="jdbc:odbc:driver={MicrosoftAccessDriver(*.mdb)};DBQ=dabaseName.mdb";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connectionconn=DriverManager.getConnection(dbURL);