SQLServer2000 JDBC驱动下载

来到微软的下载中心(downloads center) http://www.microsoft.com/downloads/

搜索字符串 JDBC

搜索结果中 SQL Server 2000 Driver for JDBC SP3就是Sqlserver 2000JDBC的驱动了

Title Release Date Popularity
SQL Server 2000 Driver for JDBC SP3

The Microsoft SQL Server 2000 Driver for JDBC is a Type 4 JDBC driver that provides highly scalable and reliable connectivity for the enterprise Java environment. This driver provides JDBC access to SQL Server 2000 through any Java-enabled applet, application, or application server.
JDBC连接SQLserver2000数据库类
import java.sql.*;

public class Database {
Connection conn;
Statement stmt;
ResultSet rs;
public Database() {
try {
Class.forName(“com.microsoft.jdbc.sqlserver.SQLServerDriver”).
newInstance();
} catch (ClassNotFoundException e) {

} catch (IllegalAccessException ex) {

} catch (InstantiationException ex) {

}

try {
String url =
“jdbc:microsoft:sqlserver://localhost:1433;databasename=testDb”;
String user = “”;
String password = “”;

conn = DriverManager.getConnection(url, user, password); //获得连接
stmt = conn.createStatement(); //获得执行SQL语言的容器
String sql = “select * from testTable”;
rs = stmt.executeQuery(sql); //获得结果集
while (rs.next()) {
System.out.println(rs.getString(1)); //拿到结果集中的第一列
}

} catch (SQLException e) {

}
}
}

原创文章,转载请注明: 转载自海波无痕

本文链接地址: SQLServer2000 JDBC驱动下载

文章的脚注信息由WordPress的wp-posturl插件自动生成

此条目发表在javaee分类目录。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

评论链接可以 移除 nofollow.