public PooledDataSource(ClassLoader driverClassLoader, String driver, String url, Properties driverProperties) { dataSource = new UnpooledDataSource(driverClassLoader, driver, url, driverProperties); expectedConnectionTypeCode = assembleConnectionTypeCode(dataSource.getUrl(), dataSource.getUsername(), dataSource.getPassword()); }
private Connection doGetConnection(Properties properties) throws SQLException { initializeDriver(); Connection connection = DriverManager.getConnection(url, properties); configureConnection(connection); return connection; }
public Integer getDefaultTransactionIsolationLevel() { return dataSource.getDefaultTransactionIsolationLevel(); }
public void forceCloseAll() { synchronized (state) { expectedConnectionTypeCode = assembleConnectionTypeCode(dataSource.getUrl(), dataSource.getUsername(), dataSource.getPassword()); for (int i = state.activeConnections.size(); i > 0; i--) { try {
protected SqlRunner getSqlRunner() { try { lazyInitializeDrivers(); Properties props = environmentProperties(); String driver = props.getProperty("driver"); String url = props.getProperty("url"); String username = props.getProperty("username"); String password = props.getProperty("password"); UnpooledDataSource dataSource = new UnpooledDataSource(driverClassLoader, driver, url, username, password); dataSource.setAutoCommit(true); return new SqlRunner(dataSource.getConnection()); } catch (SQLException e) { throw new MigrationException("Could not create SqlRunner. Cause: " + e, e); } }
public UnpooledDataSourceFactory() { this.dataSource = new UnpooledDataSource(); }
@Override public Connection getConnection() throws SQLException { return popConnection(dataSource.getUsername(), dataSource.getPassword()).getProxyConnection(); }
conn = new PooledConnection(dataSource.getConnection(), this); if (log.isDebugEnabled()) { log.debug("Created connection " + conn.getRealHashCode() + "."); conn.getRealConnection().rollback(); conn.setConnectionTypeCode(assembleConnectionTypeCode(dataSource.getUrl(), username, password)); conn.setCheckoutTimestamp(System.currentTimeMillis()); conn.setLastUsedTimestamp(System.currentTimeMillis());
public String getDriver() { return dataSource.getDriver(); }
public Properties getDriverProperties() { return dataSource.getDriverProperties(); }
public String getPassword() { return dataSource.getPassword(); }
public String getUsername() { return dataSource.getUsername(); }
public String getUrl() { return dataSource.getUrl(); }
public void forceCloseAll() { synchronized (state) { expectedConnectionTypeCode = assembleConnectionTypeCode(dataSource.getUrl(), dataSource.getUsername(), dataSource.getPassword()); for (int i = state.activeConnections.size(); i > 0; i--) { try {
protected ScriptRunner getScriptRunner() { try { lazyInitializeDrivers(); Properties props = environmentProperties(); String driver = props.getProperty("driver"); String url = props.getProperty("url"); String username = props.getProperty("username"); String password = props.getProperty("password"); String charSetName = props.getProperty("script_char_set"); PrintWriter outWriter = new PrintWriter(out); UnpooledDataSource dataSource = new UnpooledDataSource(driverClassLoader, driver, url, username, password); dataSource.setAutoCommit(false); ScriptRunner scriptRunner = new ScriptRunner(dataSource.getConnection()); scriptRunner.setCharacterSetName(charSetName); scriptRunner.setStopOnError(!force); scriptRunner.setLogWriter(outWriter); scriptRunner.setErrorLogWriter(outWriter); setPropertiesFromFile(scriptRunner, props); return scriptRunner; } catch (Exception e) { throw new MigrationException("Error creating ScriptRunner. Cause: " + e, e); } }
public PooledDataSource() { dataSource = new UnpooledDataSource(); }
@Override public Connection getConnection() throws SQLException { return popConnection(dataSource.getUsername(), dataSource.getPassword()).getProxyConnection(); }
conn = new PooledConnection(dataSource.getConnection(), this); if (log.isDebugEnabled()) { log.debug("Created connection " + conn.getRealHashCode() + "."); conn.getRealConnection().rollback(); conn.setConnectionTypeCode(assembleConnectionTypeCode(dataSource.getUrl(), username, password)); conn.setCheckoutTimestamp(System.currentTimeMillis()); conn.setLastUsedTimestamp(System.currentTimeMillis());
public String getDriver() { return dataSource.getDriver(); }
public Properties getDriverProperties() { return dataSource.getDriverProperties(); }