Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all articles
Browse latest Browse all 884

Can someone tell me what's wrong with my sql statement ? (no replies)

$
0
0
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;

Viewing all articles
Browse latest Browse all 884

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>