java.sql.SQLException: Invalid column index
hi
db throws the error : java.sql.SQLException: Invalid column index
when i update using prepdstmt
code
-publicvoid updateUser(String name, String title, String email,
Integer telephone, String userName, String password,Integer user_Id)throws DaoException{
String update =
"update users set name=?, title=?," +
" email=? , telephone=? ,userName= ?," +
"password=? where user_Id='"+user_Id+"'";
try{
System.out.println("-getting datasource for connection-");
getDataSource();
if(conn ==null){
conn = dataSource.getConnection();
System.out.println("--got connection from pool-");
}
if(conn!=null){
System.out.println("-about to execute update stmt--");
System.out.println(""+
"update users set name=?, title=?," +
" email= ,telephone=? ,userName= ?," +
"'"+user_Id+"'");
ps = conn.prepareStatement(update);
//ps.setInt(1,user_Id);
ps.setString(2,name);
ps.setString(3,title);
ps.setString(4,email);
ps.setInt(5,telephone);
ps.setString(6,userName);
ps.setString(7,password);
ps.executeUpdate();
Need help
Thanx

