Reputation: 135
I have just replaced my mysql connector jar 3.1.12 to 5.1.27. and getting error
You need to specify Statement.RETURN_GENERATED_KEYS to the Statement.executeUpdate() or Connection.prepareStatement().
I got the solution that i should use
PreparedStatement ps = connection.prepareStatement(SQL, Statement.RETURN_GENERATED_KEYS);
instead
PreparedStatement ps = connection.prepareStatement(SQL);
The main problem is how can I replace this in whole project and is there any method to set it globally?
Is there any other Issues with 5.1.27 version which I should keep in mind?
Upvotes: 1
Views: 255
Reputation: 171
This defect is already raised to MYSQL team and they have fixed this issue in version 5.1.8. But this issue still exists for latest versions. So far this has not fixed. Please refer the below link for more info -
http://bugs.mysql.com/bug.php?id=41448
Connector J 5.1.8 - Working Connector J 5.1.10 - Not Working Connector J 5.1.18 - Not Working Connector J 5.1.21 - Not Working
Upvotes: 2