PreparedStatement ps = con.prepareStatement(sql,
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rs = ps.executeQuery();
在使用PreparedStatement 查询大容量数据时内存溢出,只需在prepareStatement方法中加上ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY即可
本文介绍了一种在使用PreparedStatement查询大量数据时避免内存溢出的方法:通过设置ResultSet的类型为TYPE_SCROLL_INSENSITIVE及并发模式为CONCUR_READ_ONLY。
1748

被折叠的 条评论
为什么被折叠?



