4 ms·
There are plenty of alternatives to ORMs. We use JDBI (https://jdbi.org https://jdbi.org) which is dead simple and a happy medium between pure JDBC and a full b
by qsort 5y ago
There are plenty of alternatives to ORMs. We use JDBI (https://jdbi.org https://jdbi.org) which is dead simple and a happy medium between pure JDBC and a full blown ORM.
Even using the built-in JDBC support is an option with modern Java, PreparedStatement and ResultSet implement AutoClosable, which means you can write code like this:
try (
final var rs = conn.prepareStatement("""
<SQL here>
""").executeQuery();
) {
while (rs.next()) {
// do your thing
}
} catch (SQLException e) {
// your code here
}
Which is just the standard library and no more verbose than most other frameworks.
As for web frameworks, there's a million of them. Pick a non-magical one if you don't like magic.