java - the right syntax to use near '? WHERE Reg = ?' -


public static void updatedata(connection con, string make, string reg) {     string selectstring = "update cars set make = ? reg = ?";     try     {         preparedstatement pstmt = con.preparestatement(selectstring);         pstmt.setstring(1, make);         pstmt.setstring(2, reg);         pstmt.executeupdate(selectstring);         pstmt.close();      }... 

i getting following error piece of code:

sql exception: have error in sql syntax; check manual corresponds mariadb server version right syntax use near '? reg = ?' @ line 1 

i'll appreciate if me out. i've searched around problem quite different solutions i've found.

use overloaded executeupdate meant preparedstatements

pstmt.executeupdate(); 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -