title: The index 1 is out of range error in java application
body: <p>When I run this code:</p>
  
  <pre><code>String s = "insert into PersonalInfo(Name, FamilyName, FatherName, BirthDate, GenderID, NationalId) values";
  
  PreparedStatement pst = con.prepareStatement(s);
  pst.setString(1,Name.getText());    // error is at this line!
  pst.setString(2,FamilyName.getText());
  pst.setString(3,FatherName.getText());
  pst.setString(4,BirthDate.getText());
  if (Male.isSelected()){
      GenderID=1;
  } 
  if (Female.isSelected()){
      GenderID=2;
  }
  pst.setInt(GenderID,5);
  pst.setString(6,NationalId.getText());
  pst.executeUpdate();
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>The index 1 is out of range</p>
  </blockquote>
  
  <p>But I have no idea how to fix it.</p>