I got this error which I have been trying the whole day long but I still can't resolve it. Hope to get some help here.
The error is
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES92' at line 1
And here's my code :
connection.commit();
ResultSet tableKeys = ps.getGeneratedKeys();
int generatedId = 0;
while(tableKeys.next())
generatedId = tableKeys.getInt(1);
stmt3 = (Statement) connection.createStatement();
String sql3 =
"INSERT INTO project.tutor_subject (tutor_id)"
+ "VALUES"
+ generatedId;
The error is
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES92' at line 1
And here's my code :
connection.commit();
ResultSet tableKeys = ps.getGeneratedKeys();
int generatedId = 0;
while(tableKeys.next())
generatedId = tableKeys.getInt(1);
stmt3 = (Statement) connection.createStatement();
String sql3 =
"INSERT INTO project.tutor_subject (tutor_id)"
+ "VALUES"
+ generatedId;