First of all, how did this compile? You have the variable "sucessFlag" defined twice. However, the code is acting as expected. The javadoc for execute() says that it returns true if the query returns a resultset and false if the query returns an update count. You would have to call getUpdateCount() to get the real result. It is easier to call ...