我很想深入瞭解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