我很想深入了解ResultSet的工作。 我对ResultSet有很多疑问。 如表现明智哪一个更好。ResultSet的工作原理
while(rs.next())
{
// iterate as well as do call some other functions.
}
or
while(rs.next())
{
// iterate and store the column values in a map
}
// do functions using the map.
由于该表被许多其他并发程序访问。
这两个解决方案都是等效的,以防止并发访问使用事务。 – triclosan 2012-07-20 13:35:33
第二个不适合大的结果集,它可能会耗尽内存 – 2012-07-20 13:42:12