@Override protected Connection getConnectionFromDriver(Properties props) throws SQLException { Driver driver = getDriver(); String url = getUrl(); Assert.notNull(driver, "Driver must not be null"); if (logger.isDebugEnabled()) { logger.debug("Creating new JDBC Driver Connection to [" + url + "]"); } return driver.connect(url, props); }
/** * Hook to shutdown the embedded database. Subclasses may call this method * to force shutdown. * <p>After calling, {@link #getDataSource()} returns {@code null}. * <p>Does nothing if no embedded database has been initialized. */ protected void shutdownDatabase() { if (this.dataSource != null) { if (logger.isInfoEnabled()) { if (this.dataSource instanceof SimpleDriverDataSource) { logger.info(String.format("Shutting down embedded database: url='%s'", ((SimpleDriverDataSource) this.dataSource).getUrl())); } else { logger.info(String.format("Shutting down embedded database '%s'", this.databaseName)); } } if (this.databaseConfigurer != null) { this.databaseConfigurer.shutdown(this.dataSource, this.databaseName); } this.dataSource = null; } }
SimpleDriverDataSource simpleDriverDataSource = (SimpleDriverDataSource) this.dataSource; logger.info(String.format("Starting embedded database: url='%s', username='%s'", simpleDriverDataSource.getUrl(), simpleDriverDataSource.getUsername()));
@Override protected Connection getConnectionFromDriver(Properties props) throws SQLException { Driver driver = getDriver(); String url = getUrl(); Assert.notNull(driver, "Driver must not be null"); if (logger.isDebugEnabled()) { logger.debug("Creating new JDBC Driver Connection to [" + url + "]"); } return driver.connect(url, props); }
@Override protected Connection getConnectionFromDriver(Properties props) throws SQLException { Driver driver = getDriver(); String url = getUrl(); Assert.notNull(driver, "Driver must not be null"); if (logger.isDebugEnabled()) { logger.debug("Creating new JDBC Driver Connection to [" + url + "]"); } return driver.connect(url, props); }
/** * Hook to shutdown the embedded database. Subclasses may call this method * to force shutdown. * <p>After calling, {@link #getDataSource()} returns {@code null}. * <p>Does nothing if no embedded database has been initialized. */ protected void shutdownDatabase() { if (this.dataSource != null) { if (logger.isInfoEnabled()) { if (this.dataSource instanceof SimpleDriverDataSource) { logger.info(String.format("Shutting down embedded database: url='%s'", ((SimpleDriverDataSource) this.dataSource).getUrl())); } else { logger.info(String.format("Shutting down embedded database '%s'", this.databaseName)); } } if (this.databaseConfigurer != null) { this.databaseConfigurer.shutdown(this.dataSource, this.databaseName); } this.dataSource = null; } }
SimpleDriverDataSource simpleDriverDataSource = (SimpleDriverDataSource) this.dataSource; logger.info(String.format("Starting embedded database: url='%s', username='%s'", simpleDriverDataSource.getUrl(), simpleDriverDataSource.getUsername()));