This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Hi Friends, This my update query and I don't understand why it gives me error!!! Please help... Thanks, Elahe PrepStmt=con.prepareStatement("update bug set values (?,?,?,?,?) where bugNumber=?"); PrepStmt.setInt(1,ID); PrepStmt.setString(2,bdesc); PrepStmt.setString(3,fixedDate); PrepStmt.setInt(4,userID); PrepStmt.setString(5,contact); PrepStmt.setInt(6,bugNumber); Error: -------- You have an error in your SQL syntax near 'values (3,'I can not delete the bug#456','2001-01-01',3,'Rick-408-778-2967') whe' at line 1
Which database are you using? Not all databases support the syntax that you are using. For example, the UPDATE syntax for PostgreSQL is: UPDATE [ ONLY ] table SET col = expression [, ...] [ FROM fromlist ] [ WHERE condition ]
I believe your statement would work with MySQL. hth, bear [ January 23, 2002: Message edited by: Bear Bibeault ]