skip to Main Content

Mysql – JDBC DATETIME Type

I have a DATETIME column in a MySQL database. I use ResultSet metadata to retrieve the column type and it returns TIMESTAMP which is incorrect. How can I get the correct java.sql.SQLType value for this column? I will try to…

VIEW QUESTION

How to tell PostgreSQL via JDBC that I'm not going to fetch every row of the query result (i.e. how to stream the head of a result set efficiently)?

Quite frequently, I'd like to retrieve only the first N rows from a query, but I don't know in advance what N will be. For example: try(var stream = sql.selectFrom(JOB) .where(JOB.EXECUTE_AFTER.le(clock.instant())) .orderBy(JOB.PRIORITY.asc()) .forUpdate() .skipLocked() .fetchSize(100) .fetchLazy()) { // Now run…

VIEW QUESTION
Back To Top
Search