This content has been marked as final. Show 5 replies
Does it work?
I would take the whole database access stuff out and do that in its own thread, via some DAO object.
I would also rework it so it closed resources, and used a PreparedStatement.
But essentially it comes down to my first sentence above...
talls, actually it seems dosen't have any syntax errors ,bt in running cause problems, it code can use for update button as well ,only substitute part is database query
Well, if you have problems then it might be an idea to actually post them?
Or are we supposed to guess?
your right, i must post them, those are the errors ,
ava.sql.SQLException: After end of result set
at java.security.AccessController.doPrivileged(Native Method)
BUILD SUCCESSFUL (total time: 8 seconds)
You are executing a delete statement, what exactly are you expecting in the result set?1 person found this helpful
Take a look at the java.sql.Statement javadoc, there are better choices than executeQuery for what you are attempting.
I agree with Tolls though, a PreparedStatement would be better. The code you have written has potential for SQL injection written all over it. What if nic.getText( ) returned "abc' or nic != 'a"?