发表文章

[最新] java连接各种数据库的写法

iteye2116 2010-6-28 1

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

相关推荐
最新评论 (0)
返回
发表文章
iteye2116
文章数
451
评论数
0
注册排名
1339350