Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

WHY java.sql.SQLException: Invalid column index?

723731Oct 27 2009 — edited Oct 27 2009
DataBase 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();
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2009
Added on Oct 27 2009
3 comments
247 views