Using generating with MysqlDataSource fails with the following exception:
Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate(), Statement.executeLargeUpdate() or Connection.prepareStatement().
Even after adding the required flag during the prepared statement creation, the operation still fails with:
java.sql.SQLException: Before start of result set
This is solvable by forcing a res.next() before trying to read the generated key.
MySQL driver version: 8.0.27
Java version: 11.0.9.1
Using
generating
withMysqlDataSource
fails with the following exception:Even after adding the required flag during the prepared statement creation, the operation still fails with:
This is solvable by forcing a
res.next()
before trying to read the generated key.MySQL driver version:
8.0.27
Java version:11.0.9.1