In your query UPDATE userde set name=?,add=?,email=?,phone=? where name=? you have 5 fields(?) but in the code ps.setString(1, name); //ps.setString(2, pass1); //ps.setString(3, pass2); ps.setString(4, add); ps.setString(5, email); ps.setString(6, phone); you try to set 6 fields.
1. What exception are you getting. 2. Post the stack trace of exception 3. Which database are you using. 4. You have a column named as "add", just a suggestion to rename this column because add is a key word in many database. I wonder that your database didn't stop you at the time of table creation
Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
It's possible that the UPDATE statement updates zero rows because your "name" variable doesn't correspond to anything in the table. The ps.executeUpdate() method returns an int value that you can use to see how many rows were updated.
Joined: Dec 28, 2005
Sebo... Here using the table field "add" i can insert..create.. and search.. but now i'm not able to update.. this may the problem with.. the query.. is that so?
i've given ps.executeUpdate and also.. dbCon.commit()
i'm using the database now is MS Access.. but this is not updating...
can u please send me.. the query for updating the table in the database
I have tried with & without "VALUES". there is no effect.
Joined: Jun 22, 2005
>I have tried with & without "VALUES". there is no effect.
Checked. You can try [date]=? since ODBC MS Access driver maybe fail to support such a sql reserved word. If you still fail, you can try commercial MS Access driver, which supports both of "date=?" and "[date]=?".