请问能直接操作ResultSet类? 行不通。要求1的功能是数据库封装了的。不需要自己加以干预。即使你指定了位置,它也会给你打乱。要求2的功能可以通过sql语句来实现。而不是操作resultset来实现。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 直接用那个会出很多问题。封一次比较好,最好是用resultset取数据,用cachedrowset操作数据import sun.jdbc.rowset.CachedRowSet; public CachedRowSet executeQuery(String sql) throws java.sql.SQLException { CachedRowSet cst = new CachedRowSet(); try { conn = db.getConnection(); ps = conn.createStatement(); rs = ps.executeQuery(sql); cst.populate(rs); rs.close(); } catch (SQLException e) { System.out.println(e.getMessage()); } finally { db.CleanConnection(conn, ps, rs); } return cst; } java 集合 怎样继承通过反射得到的类? BufferedReader为什么会有数据遗漏啊? java 同步 可以在script里引用head里的变量么?? Applet程序网页内无法显示 适配器问题求助!!!!!!! 请问怎么样把字符串转变成二进制存到文件中?急! 怎样才知道我准备好考scjp呢?考一次可是很贵呀,我不想失败! 谁有JB5 的Active key? upcast和extend有什么区别啊 关于applet的问题
import sun.jdbc.rowset.CachedRowSet; public CachedRowSet executeQuery(String sql) throws java.sql.SQLException {
CachedRowSet cst = new CachedRowSet();
try {
conn = db.getConnection();
ps = conn.createStatement();
rs = ps.executeQuery(sql);
cst.populate(rs);
rs.close();
}
catch (SQLException e) {
System.out.println(e.getMessage());
}
finally {
db.CleanConnection(conn, ps, rs);
}
return cst;
}