/** * Get the number of idle connections in the pool for a given user. */ public int getNumIdle(String username, String password) { ObjectPool pool = (ObjectPool)pools.get(getPoolKey(username)); return (pool == null) ? 0 : pool.getNumIdle(); }
/** * Get the number of active connections in the pool for a given user. */ public int getNumActive(String username, String password) { ObjectPool pool = (ObjectPool)pools.get(getPoolKey(username)); return (pool == null) ? 0 : pool.getNumActive(); }
protected PooledConnectionManager getConnectionManager(UserPassKey upkey) { return (PooledConnectionManager) managers.get(getPoolKey( upkey.getUsername(), upkey.getPassword())); }
protected PooledConnectionManager getConnectionManager(UserPassKey upkey) { return (PooledConnectionManager) managers.get(getPoolKey( upkey.getUsername(), upkey.getPassword())); }
/** * Get the number of active connections in the pool for a given user. */ public int getNumActive(String username, String password) { ObjectPool pool = getPool(getPoolKey(username,password)); return (pool == null) ? 0 : pool.getNumActive(); }
/** * Get the number of idle connections in the pool for a given user. */ public int getNumIdle(String username, String password) { ObjectPool pool = getPool(getPoolKey(username,password)); return (pool == null) ? 0 : pool.getNumIdle(); }
/** * Get the number of active connections in the pool for a given user. */ public int getNumActive(String username, String password) { ObjectPool pool = getPool(getPoolKey(username,password)); return (pool == null) ? 0 : pool.getNumActive(); }
/** * Get the number of idle connections in the pool for a given user. */ public int getNumIdle(String username, String password) { ObjectPool pool = getPool(getPoolKey(username,password)); return (pool == null) ? 0 : pool.getNumIdle(); }
protected synchronized PooledConnectionAndInfo getPooledConnectionAndInfo(String username, String password) throws SQLException { PoolKey key = getPoolKey(username); Object pool = pools.get(key); if (pool == null) { try { registerPool(username, password); pool = pools.get(key); } catch (NamingException e) { throw new SQLNestedException("RegisterPool failed", e); } } PooledConnectionAndInfo info = null; try { info = (PooledConnectionAndInfo)((ObjectPool) pool).borrowObject(); } catch (Exception e) { throw new SQLNestedException( "Could not retrieve connection info from pool", e); } return info; }
throws SQLException { final PoolKey key = getPoolKey(username,password); ObjectPool pool; PooledConnectionManager manager;
throws SQLException { final PoolKey key = getPoolKey(username,password); ObjectPool pool; PooledConnectionManager manager;
isRollbackAfterValidation(), username, password); Object old = managers.put(getPoolKey(username,password), factory); if (old != null) { throw new IllegalStateException("Pool already contains an entry for this user/password: "+username);
isRollbackAfterValidation(), username, password); Object old = managers.put(getPoolKey(username,password), factory); if (old != null) { throw new IllegalStateException("Pool already contains an entry for this user/password: "+username);
username, password); pools.put(getPoolKey(username), pool);