update query using preparedstmt
hi
i get the error, SQL command not properly ended on compiling prepardstmt.
nd here is the code :
publicvoid updateUser(Integer user_Id,String name, String title, String email,
Integer telephone, String userName, String password)throws DaoException{
String update =
"update users set name=?, title=?," +
" email=? , telephone=? ,userName= ?" +
"password=? where 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--");
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();
whr the prb is ? pls let me know
Thanks

