title: What query will update data in mysql database?
body: <p>I have a query that is updating values in the database however i seem to be missing out something</p>
  
  <pre><code>String sqlStr = "INSERT INTO userdb where userID=? (username,address,email,contact,credit,userpassword)" + "VALUES (?,?,?,?,?,?)";
                  PreparedStatement pstmt = conn.prepareStatement(sqlStr);
                  pstmt.setInt(1, userid);
                  pstmt.setString(2,name);
                  pstmt.setString(3,address);
                  pstmt.setString(4,email);
                  pstmt.setInt(5,contact);
                  pstmt.setString(6,credit);
                  pstmt.setString(7,password);
                  int rec = pstmt.executeUpdate();
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where userID=1 (username,address,email,contact,credit,userpassword)VALUES ('abc'' at line 1
  </code></pre>