A question on next.jdbc out of curiosity: Doesn’t it need to figure out the type of a column from a query to call the corresponding jdbc methods (i.e. getInt, getDouble, getString etc)? If it does, then how is it figuring it out, and if it doesn’t, then how are types automatically correct? (FYI my only experience with next.jdb has been on Postgres)
getObject
The underlying jdbc driver (in your case the postgres one) does the in marshalling into java objects however it wants, and getObject just returns whatever it got
ah so if I want to see how it’s done in by the postgres driver I’ll have to look at their java source
Yeah, that will bottom out at the type description information in the pg wire protocol (I think there is kind of a header for query results in the wire protocol)
yep - in Postgres the client sends a 'describe' message, the backend replies with a 'row description' https://www.postgresql.org/docs/current/protocol-message-formats.html if you're interested in the details 🙂 the PG driver exposes all this through getMetadata on the ResultSet (which is then exposed by next.jdbc for anyone wanting more custom behaviour) - but as @/hiredman says, getObject is a reasonable default