总结一些JDBC下载资源

开发 后端
最近一个朋友遇到了一个问题,由于他的网站是用JSP编写的,而且要运行在resin的环境下,数据库使用MS SQL Server 2000,需要用到JDBC的一些资源,这里也为大家总结一下。

朋友的网站的空间是租用的,能够支持JSBC程序,但无法在租用的空间上修改resin的配置文件,也无法修改系统的环境变量,所以原来使用的weblogic的JDBC驱动无法使用(weblogic的JDBC驱动需要在环境变量中的CLASSPATH中指定License的位置),只能另想办法。想在网上寻找一个免费而且好用的JDBC驱动程序,便找到了一篇有关JDBC下载驱动程序的很不错的文章。

Db Name: Microsoft SQL Server (6.5, 7, 2000 and 2005) and Sybase (10, 11, 12).  

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JDBC Name: jTDS

Home Page: http://jtds.sourceforge.net/

JDBC Ver: 1.0.2

Download: http://sourceforge.net/project/showfiles.php?group_id=33291

Conn Code:

Class.forName("net.sourceforge.jtds.jdbc.Driver ");

Connection con = DriverManager.getConnection("jdbc:jtds:sqlserver://host:port/database","user","password");

or

Connection con = DriverManager.getConnection("jdbc:jtds:sybase://host:port/database","user","password");

Db Name: Microsoft SQL Server 2000

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JDBC Name: SQL Server 2000 Driver for JDBC

Home Page: http://www.microsoft.com/china/sql/

JDBC Ver: (SQL Server 2000 Driver for JDBC)

Download: http://www.microsoft.com/china/sql/downloads/2000/jdbc.asp

Conn Code:

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");  

Connection conn = DriverManager.getConnection ("jdbc:microsoft:sqlserver://server1:1433","user","password");

Db Name: Oracle

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JDBC Name: Connector/J  

Home Page: http://www.oracle.com/technology/software/tech/java/

JDBC Ver: (based on Oracle)

Download: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/

Conn Code:

Class.forName("oracle.jdbc.driver.OracleDriver");

Connection con = DriverManager.getConnection("jdbc:oracle:thin:@host:port:databse","user","password");

Db Name: MySQL

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JDBC Name: Connector/J

Home Page: http://dev.mysql.com/

JDBC Ver: 3.1

Download: http://dev.mysql.com/downloads/

Conn Code:

Class.forName("com.mysql.jdbc.Driver");

Connection con = DriverManager.getConnection("jdbc:mysql://host:port/database","user","password");

Db Name: Sybase

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JDBC Name: jConnect  

Home Page: http://www.sybase.com.cn/cn/content/SDN/

JDBC Ver: 4.5/5.5

Download: http://www.sybase.com/detail_lis ... ;SR=Y&show=1265

Conn Code:

Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();

DriverManager.getConnection("jdbc:sybase:Tds:IP:2638?ServiceName="+database,"user","password");

Db Name: Postgresql

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JDBC Name: PostgreSQL JDBC

Home Page: http://jdbc.postgresql.org/

JDBC Ver: 8.0 Build 310

Download: http://jdbc.postgresql.org/download.html

Conn Code:

Class.forName("org.postgresql.Driver");  

Connection con = DriverManager.getConnection("jdbc:postgresql://host:port/database","user","password");

Db Name: IBM Informix

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JDBC Name: Informix JDBC Driver (IBM Informix JDBC V3.0)

Home Page: http://www-306.ibm.com/software/data/informix/

JDBC Ver: 3.0.JC1

Download: http://www14.software.ibm.com/we ... go=y&rs=ifxjdbc

Conn Code:

Class.forName("com.informix.jdbc.IfxDriver").newInstance();  

Connection conn= DriverManager.getConnection("jdbc:informix-sqli://123.45.67.89:1533/myDB:INformIXSERVER=myserver;user=testuser;password=testpassword";);

Db Name: IBM DB2

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JDBC Name: DB2 JDBC Universal Driver

Home Page: http://www-306.ibm.com/software/data/db2/udb/  

JDBC Ver:  

Download: http://www-128.ibm.com/developerworks/db2/downloads/jcc/

Conn Code:

Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance();  

Connection conn= DriverManager.getConnection("jdbc:db2://localhost:5000/sample",user,password);  

IBM AS400主机在用的JDBC语法

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

有装V4R4以上版本的Client Access Express

可以在C:\Program Files\IBM\Client Access\jt400\lib

找到 driver 档案 jt400.zip,并更改扩展名成为 jt400.jar

Conn Code:

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");  

Db Name: Ms Access or Ms Foxpro

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Conn Code:

step 1: 配置 odbc (例如:myDb)

step 2:  

String dbURL = "jdbc:odbc:myDb";

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

 Connection conn = DriverManager.getConnection(dbURL);  

or

String dbURL = "jdbc:odbc:driver={MicrosoftAccessDriver(*.mdb)};DBQ=dabaseName.mdb";

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

 Connection conn = DriverManager.getConnection(dbURL);

【编辑推荐】

  1. 使用JDBC的五个精华功能
  2. Tomcat5+MySQL JDBC连接池配置
  3. 在Weblogic中实现JDBC的功能
  4. 详解JDBC与Hibernate区别
  5. JDBC连接MySQL数据库关键四步
  6. 浅谈JDBC DAO的设计理念
责任编辑:彭凡 来源: 51myit.com
相关推荐

2021-05-21 11:20:36

Linux命令文件

2011-11-28 15:57:26

MySQL数据库主从配置

2011-07-12 09:47:53

WebService

2012-01-09 16:02:19

JavaJVM

2009-06-22 15:36:00

如何学好java

2009-09-27 11:09:42

API设计

2015-12-08 09:05:41

Java内部类

2009-11-26 10:32:57

PHP代码优化

2009-12-11 11:09:12

PHP信息函数

2020-09-28 06:45:42

故障复盘修复

2012-07-03 13:55:00

ASP.NET

2020-05-19 14:35:42

Shell脚本循环

2020-04-10 08:50:37

Shell脚本循环

2013-12-24 14:50:39

Ember.js框架

2011-09-13 09:41:59

Python

2018-07-23 12:03:01

2020-10-19 19:25:32

Python爬虫代码

2018-11-15 08:19:47

大流量高并发限流

2010-05-12 17:45:01

IIS 服务器

2009-08-12 11:20:51

C#运算符重载
点赞
收藏

51CTO技术栈公众号