mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
no effective code change: add some try-with resources (#978)
* no effective code change: add some try-with resources * moved return statement outside try-with-resources, because otherwise the order changes
This commit is contained in:
1 parent
a315c7c11e
commit
ca777d7967
12 files changed
+34
-54
No files matched your search
@@ -115,18 +115,13 @@ public class BatchedPstmt {
|
||||
private void getGeneratedKeys() throws SQLException {
|
||||
|
||||
int index = 0;
|
||||
ResultSet rset = pstmt.getGeneratedKeys();
|
||||
try {
|
||||
try (ResultSet rset = pstmt.getGeneratedKeys()) {
|
||||
while (rset.next()) {
|
||||
Object idValue = rset.getObject(1);
|
||||
list.get(index).setGeneratedKey(idValue);
|
||||
index++;
|
||||
}
|
||||
} finally {
|
||||
if (rset != null) {
|
||||
rset.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user