+ dbtester = new DataSourceDatabaseTester(dataSource);
+ connections = new ArrayList<IDatabaseConnection>();
+ }
+
+ /**
+ * Starts the database utils.
+ */
+ public void start() {
+ // Empty. No operation currently.
+ }
+
+ /**
+ * Stops the database utils, closing any JDBC connections that were created
+ * by this utility. Note that connections obtained from the datasource directly
+ * must still be closed by the user. The involved connections are only those that
+ * are created by this utility.
+ */
+ public void stop() {
+ for (IDatabaseConnection connection: connections) {
+ try {
+ connection.close();
+ } catch (SQLException e) {
+ LOG.log(Level.WARNING, "Could not close connection", e);
+ }
+ }
+ connections.clear();