sql 2026-03-17

In next.jdbc, is it possible to reproduce the following piece of code?

try (Statement stmt = conn.createStatement();
     ResultSet rs = stmt.executeQuery("SELECT my_bits FROM my_table")) {
    if (rs.next()) {
        java.util.BitSet bitSet = rs.getObject("my_bits", java.util.BitSet.class);
        //                                                ^^^^^^^^^^^^^^^^^^^^^^^
    }
} catch (Exception e) {
    e.printStackTrace();
}
The main point is a custom class which is passed into the getObject method. I'd like to handle bit strings as a BitSet. Without it, the column comes as a plain string with 0 and 1 characters

If there's a specific java.sql.<Type> for the DB column, you can extend ReadableColumn to that type, but that's global for your app (since it's a protocol).

The alternative is the builder-adapter which can take a custom column reader for a specific query / result set.

The Tips &amp; Tricks page has examples of both.

(the in-progress next version allows for an optimized builder-adapter that can pre-build the column reader functions once per result set, rather than running that selection logic on every column of every row)

Does that help at all @igrishaev?

Yeah that's definitely something to experiment with, thanks a lot!