public void closeDataSource(DataSource dataSource) { super.closeDataSource(dataSource); if (!shutdownOnClose) return; // as well as closing the DataSource, we also need to // shut down the instance if we are using an embedded database, which // can only be done by connecting to the same URL with the // ";shutdown=true" string appended to the end // see: http://db.apache.org/derby/docs/dev/devguide/tdevdvlp40464.html if (conf != null && conf.getConnectionDriverName() != null && conf.getConnectionDriverName().indexOf("EmbeddedDriver") != -1) { try { DriverManager.getConnection(conf.getConnectionURL() + ";shutdown=true"); } catch (SQLException e) { // we actuall expect a SQLException to be thrown here: // Derby strangely uses that as a mechanism to report // a successful shutdown } } }
public void closeDataSource(DataSource dataSource) { super.closeDataSource(dataSource); if (!shutdownOnClose) return; // as well as closing the DataSource, we also need to // shut down the instance if we are using an embedded database, which // can only be done by connecting to the same URL with the // ";shutdown=true" string appended to the end // see: http://db.apache.org/derby/docs/dev/devguide/tdevdvlp40464.html if (conf != null && conf.getConnectionDriverName() != null && conf.getConnectionDriverName().indexOf("EmbeddedDriver") != -1) { try { DriverManager.getConnection(conf.getConnectionURL() + ";shutdown=true"); } catch (SQLException e) { // we actually expect a SQLException to be thrown here: // Derby strangely uses that as a mechanism to report // a successful shutdown } } }
public void closeDataSource(DataSource dataSource) { super.closeDataSource(dataSource); if (!shutdownOnClose) return; // as well as closing the DataSource, we also need to // shut down the instance if we are using an embedded database, which // can only be done by connecting to the same URL with the // ";shutdown=true" string appended to the end // see: http://db.apache.org/derby/docs/dev/devguide/tdevdvlp40464.html if (conf != null && conf.getConnectionDriverName() != null && conf.getConnectionDriverName().indexOf("EmbeddedDriver") != -1) { try { DriverManager.getConnection(conf.getConnectionURL() + ";shutdown=true"); } catch (SQLException e) { // we actually expect a SQLException to be thrown here: // Derby strangely uses that as a mechanism to report // a successful shutdown } } }
public void closeDataSource(DataSource dataSource) { super.closeDataSource(dataSource); if (!shutdownOnClose) return; // as well as closing the DataSource, we also need to // shut down the instance if we are using an embedded database, which // can only be done by connecting to the same URL with the // ";shutdown=true" string appended to the end // see: http://db.apache.org/derby/docs/dev/devguide/tdevdvlp40464.html if (conf != null && conf.getConnectionDriverName() != null && conf.getConnectionDriverName().indexOf("EmbeddedDriver") != -1) { try { DriverManager.getConnection(conf.getConnectionURL() + ";shutdown=true"); } catch (SQLException e) { // we actually expect a SQLException to be thrown here: // Derby strangely uses that as a mechanism to report // a successful shutdown } } }
public void closeDataSource(DataSource dataSource) { super.closeDataSource(dataSource); if (!shutdownOnClose) return; // as well as closing the DataSource, we also need to // shut down the instance if we are using an embedded database, which // can only be done by connecting to the same URL with the // ";shutdown=true" string appended to the end // see: http://db.apache.org/derby/docs/dev/devguide/tdevdvlp40464.html if (conf != null && conf.getConnectionDriverName() != null && conf.getConnectionDriverName().indexOf("EmbeddedDriver") != -1) { try { DriverManager.getConnection(conf.getConnectionURL() + ";shutdown=true"); } catch (SQLException e) { // we actually expect a SQLException to be thrown here: // Derby strangely uses that as a mechanism to report // a successful shutdown } } }