有否无连接的ResultSet? 我看到有些Jsp里面用Vector或ArrayList来存储数据,但显然不是上策。JBuilder里面应该有这样的类,不知道比较通用的Java里面有没有? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 取出数据后放在vector中,这是比较能用的做法了,还有些处理办法是存在数组中的。 sun.jdbc.rowset.CachedRowset实现了rowset的所有方法,但是有可以脱离连接存在例子: //输入:sql语句 //输出:查询的结果集 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; }取出来了就可以直接用了 请到http://expert.csdn.net/Expert/topic/1897/1897580.xml?temp=.7594263去说。我发了两遍。不好意思,控制不了事态这边我就结贴了。下面如有回答,我将诅咒你!呵呵 iText pdf 如何提取对象 u3d对象 【请教】如何补充安装Weblogic和OSB的example啊? 谁能给我提供一个spring 3.0 mvc + hibernate配置的例子 程序员的婚姻 hibernate如何自动生成表 急救啊, 关于eWebEditor在线文本编辑器--飞鱼修改版的问题 html:select的一个问题。 关于struts的validator框架的一个莫名其妙的问题~~急 软件运行时错误 Hibernate 字符串 需要一个 Ant J2EE菜鸟问题.
实现了rowset的所有方法,但是有可以脱离连接存在
例子:
//输入:sql语句
//输出:查询的结果集
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;
}
取出来了就可以直接用了
http://expert.csdn.net/Expert/topic/1897/1897580.xml?temp=.7594263
去说。
我发了两遍。不好意思,控制不了事态
这边我就结贴了。
下面如有回答,我将诅咒你!呵呵