Link to home
Start Free TrialLog in
Avatar of air_jutt
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(sql);
          // pst.setString(1,txt_Uid.getText());
            pst.setString(1,txt_Uname.getText());
            pst.setString(2,txt_Uaddress.getText());
            pst.setString(3,txt_Ucnic.getText());
            pst.setString(4,txt_Uphone.getText());
            pst.setString(5,txt_Uid.getText());
           
     
       pst.execute();
       JOptionPane.showMessageDialog(null,"Updated!");
       con.close();
      }
      catch(Exception e){
          JOptionPane.showMessageDialog(null,e);
      }
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial