title: Oracle update statement in java
body: <p>This is my code for the <code>Oracle database</code> to update a record I have done insert delete and search but fail to update.  Kindly suggest to me what's wrong in the code or in the query.</p>
  
  <pre><code>Statement stmt;
  try {
      stmt = DBPRoject.conn.createStatement();
      stmt.executeUpdate("update personinfo set cnic='"+CnicNo+"','name="+name+"','login="+login+"','password="+psd+"','zip="+Zip+"','persontypeid="+typeid+"' where cnic="+CnicNo);
      //stmt.executeQuery("update  personinfo set cnic=" + '"+CnicNo+"', '"+name+"', '"+login+"', '"+psd+"', '"+Zip+"',+typeid+);
      stmt.executeQuery("commit");
      stmt.executeQuery("update  personcont set cnic='"+CnicNo+", 'address="+HomeAdd+"', 'city="+City+"', 'statep="+State+"', 'mobno="+MobNo+"','email="+Email+"','nationality="+Nationality+"','persontypeid"+typeid+"','status"+Status+"' where cnic="+CnicNo);
      stmt.executeQuery("commit");
      JOptionPane.showMessageDialog(null, "Updated sucessfully"); 
  
  }
  catch(SQLIntegrityConstraintViolationException uni){
      JOptionPane.showMessageDialog(null, "Enter Uniqe CNIC");
      return;
  }
  catch (SQLException ex) {
      Logger.getLogger(Add_Customer.class.getName()).log(Level.SEVERE, null, ex);
  }
  </code></pre>
  
  <p>I am stuck at this point need some help :) thanks in advance.</p>