mardi 3 février 2015

what does parameterIndex mean in this syntax pst.setString(parameterIndex, x);?

I have a code as follow:



String query = "select * from EmployerData where userName = ? and password = ?";
PreparedStatement pst = connect.prepareStatement(query);
pst.setString(1, textField.getText()); // what 1 refers to
pst.setString(2, passwordField.getText()); // 2


which is working perfectly as I want but I get confused about the meaning of parameterIndex. What does parameterIndex mean???


Aucun commentaire:

Enregistrer un commentaire