Prepared Stmt execution is failing with auto genrerated keys option
I am executing a prepared statement with auto generated keys set.
It looks like following. Actually im trying to get the auto generated keys after the execution of prepared statement . But it is failing.
String query= "INSERT INTO AlertMessage WITH(ROWLOCK) (Message) VALUES (?)";
PreparedStatement pstmt = null;
pstmt= connection.prepareStatement(query, PreparedStatement.RETURN_GENERATED_KEYS);
pstmt.setString(1, "Suresh testing ");
int i = pstmt.executeUpdate();
Error that I am getting is given below and I am using datsource configured through JDBC connector service to get the database connection.
Exception id: [001438BD95D9003E00000051000012AC000458318FF1FC64]
Could you pls. provide any suggestions or solutions to this.
Thanks in advance,
With best regards,