2007-10-26
连接mssql2000
关键字: 连接mssql2000 private static void connect2000() {
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn = DriverManager
.getConnection(
"jdbc:microsoft:sqlserver://192.168.6.45:1433;DatabaseName=pubs",
"sa", "sa");
PreparedStatement pstm = conn
.prepareStatement("select * from jobs");
ResultSet rs = pstm.executeQuery();
while (rs.next()) {
System.out.println("job_id=" + rs.getInt("job_id"));
}
if (rs != null) {
rs.close();
}
if (pstm != null) {
pstm.close();
}
if (conn != null) {
conn.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
发表评论
- 浏览: 17555 次
- 性别:

- 来自: 广州

- 详细资料
搜索本博客
我的相册
2008-6-26
共 122 张
共 122 张
最近加入圈子
最新评论
-
创建XMLHttpRequest对象及 ...
返回XML文档 PrintWriter out = null; try ...
-- by weiweichen1985 -
存储过程的创建和调用。。 ...
嵌套循环 CREATE DEFINER=`root`@`localhost` ...
-- by weiweichen1985 -
js实现的年月日三级联动
日历来的更简洁,让用户操作三遍,不符合用户体验。
-- by igogo007 -
js实现的年月日三级联动
谢谢了,代码我收藏了啊
-- by hanhan7673 -
word提示用安全模式打开
...
-- by sunfengcheng






评论排行榜