If the query to be executed does not perform a write operation, Query::executeQuery issues conn.setAutoCommit(false). This appears to be connected to a need by PostGIS for this.
With the DB2 JDBC, this causes an exception when the connection is closed but a commit has not performed. With the call to setAutoCommit(false), when the result set and statement are closed, no commit is performed and the subsequent attempt to close the connection fails.
The logic in executeQuery should probably delegate the value of autoCommit to be set to the appropriate DataStore.
This is a minor problem now but it will be a major problem if the DB2 JDBC is supported.