yes, does the trick. Only missing feature is the "multiple resources in a single try expression" aka
try (Connection c = getConnection(); ResultSet rs = getRS(c, query) { while (rs.next()) { ... } }
e
elizarov
02/03/2017, 8:09 AM
nkiesel: If I were writing a lot of this kind of code then I'd write a couple of helper inline functions for myself, so that my actual DB-access code is clean and beautiful like:
Copy code
withConnection {
forEachRow(query) {
// do something with it
}
forEachRow(anotherQuery) {
// do something with it
}
}
elizarov
02/03/2017, 8:10 AM
In Kotlin you don't have to suffer with repeating bolierplate code.