how to delete row in database?, pls help in my coding
ramesh kumar
Ranch Hand
Joined: Nov 16, 2000
Posts: 32
posted
0
HI I am doing a projects which has to delete a row in a data base , and the it is a servlet coding. when executing the code in a browser, i am getting a message viz. "oops, error[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause" kindly go through my coding and let me know the bug plzz
String stri = "delete from members (name, address)" + "values(?,?)"; PreparedStatement stmt = con.prepareStatement(stri); stmt.setString(1,username); May be changed to:
String stri = "delete from members WHERE USERNAMECOLUMN = ?"; PreparedStatement stmt = con.prepareStatement(stri); stmt.setString(1,username); //suppose 1 -> USERNAMECOLUMN of the database