This is my code:
statement.clearBatch();
statement.cancel();
statement.close();
Is it necessary to clearBatch and cancel?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
clearBatch()clears the current batch so you can add a new one.cancel()cancels the currently executing statement even in another thread.close()closes the statement and releases any associated resources such asResultSets.They all do different things. You call them when you want those things done. I don’t see that any of them implies any other.