/** * Gets a <b>non-pooled</b> connection, unless the user and password are the * same as the default values for this connection pool. * * @return A pooled connection. * @throws SQLException * Occurs when no pooled connection is available, and a new physical * connection cannot be created. */ public Connection getConnection(String user, String password) throws SQLException { // If this is for the default user/password, use a pooled connection if (user == null || (user.equals(getUser()) && ((password == null && getPassword() == null) || (password != null && password.equals(getPassword()))))) { return getConnection(); } // Otherwise, use a non-pooled connection if (!initialized) { initialize(); } return super.getConnection(user, password); }
/** * Gets a <b>non-pooled</b> connection, unless the user and password are the * same as the default values for this connection pool. * * @return A pooled connection. * @throws SQLException * Occurs when no pooled connection is available, and a new physical * connection cannot be created. */ public Connection getConnection(String user, String password) throws SQLException { // If this is for the default user/password, use a pooled connection if (user == null || (user.equals(getUser()) && ((password == null && getPassword() == null) || (password != null && password.equals(getPassword()))))) { return getConnection(); } // Otherwise, use a non-pooled connection if (!initialized) { initialize(); } return super.getConnection(user, password); }
/** * Gets a <b>non-pooled</b> connection, unless the user and password are the * same as the default values for this connection pool. * * @return A pooled connection. * @throws SQLException * Occurs when no pooled connection is available, and a new physical * connection cannot be created. */ public Connection getConnection(String user, String password) throws SQLException { // If this is for the default user/password, use a pooled connection if (user == null || (user.equals(getUser()) && ((password == null && getPassword() == null) || (password != null && password.equals(getPassword()))))) { return getConnection(); } // Otherwise, use a non-pooled connection if (!initialized) { initialize(); } return super.getConnection(user, password); }