I would like to know if we can reuse the same Statement object for executing more than one query. Or, should we create a new statement for different queries.
In the above case, is there any harm in using the same statement st1 for both the executeUpdate() queries?
SCJP 1.4 85%
posted 7 years ago
Yes you can use the same statement object, after all it is just as instance of class Connection. And with that instance you are invoking the method executeUpdate(). If it behaves differently then the basic OO Concepts itself is incorrect