air_jutt
asked on
syntax error (missing operator) in query expression 'Pa_RAM003 WHARE ID=PA_RAM004'
Hello sir I am trying to update my database record via java so when i try to run this error occur my updating code is
try
{
String sql="UPDATE Customerinfo SET cName=?,Address=?,CNIC=?, Phone=? WHARE ID=? ";
pst=con.prepareStatement(s ql);
// pst.setString(1,txt_Uid.ge tText());
pst.setString(1,txt_Uname. getText()) ;
pst.setString(2,txt_Uaddre ss.getText ());
pst.setString(3,txt_Ucnic. getText()) ;
pst.setString(4,txt_Uphone .getText() );
pst.setString(5,txt_Uid.ge tText());
pst.execute();
JOptionPane.showMessageDia log(null," Updated!") ;
con.close();
}
catch(Exception e){
JOptionPane.showMessageDia log(null,e );
}
try
{
String sql="UPDATE Customerinfo SET cName=?,Address=?,CNIC=?, Phone=? WHARE ID=? ";
pst=con.prepareStatement(s
// pst.setString(1,txt_Uid.ge
pst.setString(1,txt_Uname.
pst.setString(2,txt_Uaddre
pst.setString(3,txt_Ucnic.
pst.setString(4,txt_Uphone
pst.setString(5,txt_Uid.ge
pst.execute();
JOptionPane.showMessageDia
con.close();
}
catch(Exception e){
JOptionPane.showMessageDia
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.