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
Post a Comment