/** * Return a connection to use. */ private Connection getConnection() throws SQLException { return _conf.getDataSource2(null).getConnection(); }
/** * Return a connection to use. */ private Connection getConnection() throws SQLException { return _conf.getDataSource2(null).getConnection(); }
/** * Return a connection to use. */ private Connection getConnection() throws SQLException { return _conf.getDataSource2(null).getConnection(); }
/** * Return a connection to use. */ private Connection getConnection() throws SQLException { return _conf.getDataSource2(null).getConnection(); }
/** * Return a connection to use. */ private Connection getConnection() throws SQLException { return _conf.getDataSource2(null).getConnection(); }
/** * Construct a tool to perform the given action. */ public SchemaTool(JDBCConfiguration conf, String action) { if (action != null && !Arrays.asList(ACTIONS).contains(action)) throw new IllegalArgumentException("action == " + action); _conf = conf; _action = action; _ds = conf.getDataSource2(null); _log = conf.getLog(JDBCConfiguration.LOG_SCHEMA); // initialize this up-front; otherwise the dbdictionaryfactory might // try to take a connection to initialize when we've already got one: // bad news if the max pool is 1 _dict = _conf.getDBDictionaryInstance(); }
private final DataSource getDataSource(StoreContext ctx) { DataSource ds; if(useConnectionFactory2(ctx)) { ds = _conf.getDataSource2(ctx); } else { ds = _conf.getDataSource(ctx); } return ds; }
private DataSource getDataSource(StoreContext ctx) { DataSource ds; if(useConnectionFactory2(ctx)) { ds = _conf.getDataSource2(ctx); } else { ds = _conf.getDataSource(ctx); } return ds; }
private DataSource getDataSource(StoreContext ctx) { DataSource ds; if(useConnectionFactory2(ctx)) { ds = _conf.getDataSource2(ctx); } else { ds = _conf.getDataSource(ctx); } return ds; }
private final DataSource getDataSource(StoreContext ctx) { DataSource ds; if(useConnectionFactory2(ctx)) { ds = _conf.getDataSource2(ctx); } else { ds = _conf.getDataSource(ctx); } return ds; }
/** * Construct a tool to perform the given action. */ public SchemaTool(JDBCConfiguration conf, String action) { if (action != null && !Arrays.asList(ACTIONS).contains(action)) { Configurations.configureInstance(this, conf, action, action); } _conf = conf; _action = action; _ds = ACTION_BUILD.equals(action) ? null : conf.getDataSource2(null); _log = conf.getLog(JDBCConfiguration.LOG_SCHEMA); // initialize this up-front; otherwise the dbdictionaryfactory might // try to take a connection to initialize when we've already got one: // bad news if the max pool is 1 _dict = _conf.getDBDictionaryInstance(); }
/** * Construct a tool to perform the given action. */ public SchemaTool(JDBCConfiguration conf, String action) { if (action != null && !Arrays.asList(ACTIONS).contains(action)) { Configurations.configureInstance(this, conf, action, action); } _conf = conf; _action = action; _ds = ACTION_BUILD.equals(action) ? null : conf.getDataSource2(null); _log = conf.getLog(JDBCConfiguration.LOG_SCHEMA); // initialize this up-front; otherwise the dbdictionaryfactory might // try to take a connection to initialize when we've already got one: // bad news if the max pool is 1 _dict = _conf.getDBDictionaryInstance(); }
/** * Construct a tool to perform the given action. */ public SchemaTool(JDBCConfiguration conf, String action) { if (action != null && !Arrays.asList(ACTIONS).contains(action)) { Configurations.configureInstance(this, conf, action, action); } _conf = conf; _action = action; _ds = ACTION_BUILD.equals(action) ? null : conf.getDataSource2(null); _log = conf.getLog(JDBCConfiguration.LOG_SCHEMA); // initialize this up-front; otherwise the dbdictionaryfactory might // try to take a connection to initialize when we've already got one: // bad news if the max pool is 1 _dict = _conf.getDBDictionaryInstance(); }
/** * Construct a tool to perform the given action. */ public SchemaTool(JDBCConfiguration conf, String action) { if (action != null && !Arrays.asList(ACTIONS).contains(action)) { Configurations.configureInstance(this, conf, action, action); } _conf = conf; _action = action; _ds = ACTION_BUILD.equals(action) ? null : conf.getDataSource2(null); _log = conf.getLog(JDBCConfiguration.LOG_SCHEMA); // initialize this up-front; otherwise the dbdictionaryfactory might // try to take a connection to initialize when we've already got one: // bad news if the max pool is 1 _dict = _conf.getDBDictionaryInstance(); }
/** * Constructor. * * @param conf configuration for connecting to the data store */ public SchemaGenerator(JDBCConfiguration conf) { // note: we cannot assert developer capabilities in this tool like // we normally do because this class is also used at runtime _ds = conf.getDataSource2(null); _log = conf.getLog(JDBCConfiguration.LOG_SCHEMA); // cache this now so that if the conn pool only has 1 connection we // don't conflict later with the open databasemetadata connection _dict = conf.getDBDictionaryInstance(); // create a table of allowed schema and tables to reflect on _allowed = parseSchemasList(conf.getSchemasList()); }
/** * Ensure that the driver vendor has been set, and if not, set it now. */ public void ensureDriverVendor() { if (driverVendor != null) { cacheDriverBehavior(driverVendor); return; } if (log.isInfoEnabled()) log.info(_loc.get("oracle-connecting-for-driver")); Connection conn = null; try { conn = conf.getDataSource2(null).getConnection(); connectedConfiguration(conn); } catch (SQLException se) { throw SQLExceptions.getStore(se, this); } finally { if (conn != null) try { conn.close(); } catch (SQLException se) { } } }
/** * Ensure that the driver vendor has been set, and if not, set it now. */ public void ensureDriverVendor() { if (driverVendor != null) { cacheDriverBehavior(driverVendor); return; } if (log.isInfoEnabled()) log.info(_loc.get("oracle-connecting-for-driver")); Connection conn = null; try { conn = conf.getDataSource2(null).getConnection(); connectedConfiguration(conn); } catch (SQLException se) { throw SQLExceptions.getStore(se, this); } finally { if (conn != null) try { conn.close(); } catch (SQLException se) { } } }
/** * Ensure that the driver vendor has been set, and if not, set it now. */ public void ensureDriverVendor() { if (driverVendor != null) { cacheDriverBehavior(driverVendor); return; } if (log.isInfoEnabled()) log.info(_loc.get("oracle-connecting-for-driver")); Connection conn = null; try { conn = conf.getDataSource2(null).getConnection(); connectedConfiguration(conn); } catch (SQLException se) { throw SQLExceptions.getStore(se, this); } finally { if (conn != null) try { conn.close(); } catch (SQLException se) { } } }
/** * Ensure that the driver vendor has been set, and if not, set it now. */ public void ensureDriverVendor() { if (driverVendor != null) { cacheDriverBehavior(driverVendor); return; } if (log.isInfoEnabled()) log.info(_loc.get("oracle-connecting-for-driver")); Connection conn = null; try { conn = conf.getDataSource2(null).getConnection(); connectedConfiguration(conn); } catch (SQLException se) { throw SQLExceptions.getStore(se, this); } finally { if (conn != null) try { conn.close(); } catch (SQLException se) { } } }
public void setContext(StoreContext ctx, JDBCConfiguration conf) { _ctx = ctx; _conf = conf; _dict = _conf.getDBDictionaryInstance(); _sql = _conf.getSQLFactoryInstance(); LockManager lm = ctx.getLockManager(); if (lm instanceof JDBCLockManager) _lm = (JDBCLockManager) lm; if (!ctx.isManaged() && _conf.isConnectionFactoryModeManaged()) _ds = _conf.getDataSource2(ctx); else _ds = _conf.getDataSource(ctx); if (_conf.getUpdateManagerInstance().orderDirty()) ctx.setOrderDirtyObjects(true); }