HikariCP icon indicating copy to clipboard operation
HikariCP copied to clipboard

Return `null` when applicable from `getGeneratedKeys`

Open elpete opened this issue 4 months ago • 0 comments

Currently, there is no way to check if getGeneratedKeys returned null. Instead, when trying to call ResultSet.next() a NullPointerException is thrown.

This method should return an empty ResultSet when there are no generated keys, but not all JDBC drivers do (like Apache Derby) In these cases, I think the safest option is to return null, which can then be checked (and is checked in popular JDBC libraries like JOOQ.)

elpete avatar Feb 28 '24 23:02 elpete