帮忙改错,提示ResultSet已关闭

来源:百度知道 编辑:UC知道 时间:2024/04/28 12:31:03
百度字数限制,代码在我空间里

我知道我错在哪里可就是不知道怎么改
http://hi.baidu.com/%C9%F1%C0%B4%D6%AE%B1%CA01/blog/item/9554122b90e661315343c1ad.html

后台也在 我空间里

public class wlw {

private static Connection con = null;

private static ResultSet rs = null;

private String drive = "com.microsoft.sqlserver.jdbc.SQLServerDriver";

private String url = "jdbc晕qlserver://localhost:1433;databaseName=xinxing;user=wjx;password=;";

public wlw () {
try {
Class.forName(drive);
System.out.println("drive is ok!");
con = DriverManager.getConnection(url);
System.out.println("connection is ok!");
} catch (Exception e1) {
System.out.println(e1);
}
}

public Statement getStatement() {
try {
return con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);