Syntax error on Java PreparedStatement.setBytes with mysql -


I am trying to install the Blob MySQL area with the PreparedStatement.setBytes method. The problem is that the question ends with having a string bytes. To insert it is more or less

Then, here is the code where it is about:.

  created account stmt = this.getStatement ("update table user SET logintoken =? WHERE qrid =?"); Stmt.setBytes (1, token); Stmt.setString (2, times .getId ()); Stmt.execute ();  

For the record, the token is a byte [] always generated by 20 SecureRandom

and herebytes the error:

  Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: There is an error in your SQL syntax; The manual that matches the correct version of the correct syntax to check 'Tables users' SET logintoken = x'6DA9D5137B059AE6BCFE7F170693A76CA6484FFB24963BF88AA' on line1  

You can see, It breaks into the beginning of an X locations' data logically since this query is not contained within the part of the data string.

I assume that PreparedStatement.setBytes had resolved the problem but it is not so. I have also tried it with a java.sql blob object, but it has given almost the same issues.

Is there something I'm missing?

Look closely at your UPDATE query, table not required It should be just like

  UPDATE user set login = =? Where qrid =?  

See for more information.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -