Updating the query using jsp for updating dynamic data

advertisements

Connection is working properly. i am able to insert rows but getting exception (SQLException: ORA-00933: SQL command not properly ended ) in updating the table , using following code.( BOX_ID is integer ,rest are varchar)

PreparedStatement p_statement2=connection.prepareStatement("UPDATE TOYS_TABLE SET NAME= ? VENDOR=? LABLE=? WHERE NAME=? AND BOX_ID=?");
p_statement2.setString(1, "abc1");
p_statement2.setString(2, "abc2");
p_statement2.setString(3, "abc3");
p_statement2.setString(4, "XYZ123");
p_statement2.setInt(5,11);

try
{

   p_statement2.executeUpdate();
   p_statement2.close();
}
catch(Exception kl)
{
   kl.toString();
   p_statement2.close();
}


change this

UPDATE TOYS_TABLE SET NAME= ? VENDOR=? LABLE=? WHERE NAME=? AND BOX_ID=?

to

UPDATE TOYS_TABLE SET NAME= ?, VENDOR=? , LABLE=?, WHERE NAME=? AND BOX_ID=?