WHY java.sql.SQLException: Invalid column index?
723731Oct 27 2009 — edited Oct 27 2009DataBase db=new DataBase();
db.initialize();
PreparedStatement pstmt;
//The code above is to connect the database and I am sure that there is no problem.
try{
pstmt = db.conn.prepareStatement("INSERT INTO USERS VALUES");
String ID="sasdf";
String PASSWORD="asdf";
String ORG="sdaf";
String PHONENUMBER="ssadfsdf";
pstmt.setString(1,ID);
pstmt.setString(2, PASSWORD);
pstmt.setString(3, ORG);
pstmt.setString(4,PHONENUMBER);
//pstmt.executeUpdate();
//db.conn.commit();
}
catch(SQLException e)
{
System.out.println(e);
}
db.conn.close();