title: "Column count doesn't match value count at row 1" error in program
body: <p>I am inserting values into a database but get a "column count doesnt match value count value at row1" error.       </p>
  
  <pre><code>try {
      Class.forName("com.mysql.jdbc.Driver");
      connection = DriverManager.getConnection(connectionURL, "root", "root");
      String sql = "insert into login(username,password) values(?,?)";
      PreparedStatement pst = connection.prepareStatement(sql);
      pst.setString(1, username);
      pst.setString(2, password);
  
      int numRowsChanged = pst.executeUpdate();
      out.println(" Data has been submitted ");
  
      pst.close();
  } catch (ClassNotFoundException e) {
      out.println("Couldn't load database driver: " + e.getMessage());
  } catch (SQLException e) {
      out.println("SQLException caught: " + e.getMessage());
  } catch (Exception e) {
      out.println(e);
  } finally {
      try {
          if (connection != null)
              connection.close();
      } catch (SQLException ignored) {
          out.println(ignored);
      }
  }
  </code></pre>
  
  <p>This my table in MySql database:</p>
  
  <pre><code>           +----------+-------------+------+-----+---------+-------+
             | Field    | Type        | Null | Key | Default | Extra |
             +----------+-------------+------+-----+---------+-------+
             | username | varchar(20) | YES  |     | NULL    |       |
             | password | varchar(15) | YES  |     | NULL    |       |
             +----------+-------------+------+-----+---------+-------+
  </code></pre>
  
  <p>Why am I getting this error? Is there something wrong in my code?
  Please help me.......</p>