Michelle Ruth wrote:So it does work with java but I can't get the query to work.
Have a look at this
PreparedStatement example.
I've just noticed that you are doing an UPDATE rather than a SELECT, so there won't be any ResultSet, so you don't need the
rs variable and lines 136 - 170 of your code can be got rid of.
The only things you need to do are assign values to the four question marks on line 128 of your code and then call the executeUpdate method.
You do the first with the PreparedStatement.setXXX methods - which ones depends on the type of the column in your database.
For example, if the email field is a
String in your db, you will have something like
The 3 indicates that you are setting the value for the 3rd of the four fields.
Once you have set the values for the four fields you then call the executeUpdate method
Note: my JDBC is a little rusty, so you may need to tweak things a littler, but the sample I linked to should get you started.