/** * Set the current password in the form of a char array. * * @param password the new password in the form of a char array. */ public void setPasswordChars(char[] password) { if (isDebugEnabled()) { debugCode("setPasswordChars(new char[0]);"); } this.passwordChars = password; }
private JdbcConnection getJdbcConnection(String user, char[] password) throws SQLException { if (isDebugEnabled()) { debugCode("getJdbcConnection("+quote(user)+", new char[0]);"); } Properties info = new Properties(); info.setProperty("user", user); info.put("password", password); Connection conn = Driver.load().connect(url, info); if (conn == null) { throw new SQLException("No suitable driver found for " + url, "08001", 8001); } else if (!(conn instanceof JdbcConnection)) { throw new SQLException( "Connecting with old version is not supported: " + url, "08001", 8001); } return (JdbcConnection) conn; }
/** * Open a new pooled connection using the current URL and the specified user * name and password. * * @param user the user name * @param password the password * @return the connection */ @Override public PooledConnection getPooledConnection(String user, String password) throws SQLException { if (isDebugEnabled()) { debugCode("getPooledConnection("+quote(user)+", \"\");"); } return getXAConnection(user, password); }
/** * Open a new connection using the current URL and the specified user name * and password. * * @param user the user name * @param password the password * @return the connection */ @Override public Connection getConnection(String user, String password) throws SQLException { if (isDebugEnabled()) { debugCode("getConnection("+quote(user)+", \"\");"); } return getJdbcConnection(user, convertToCharArray(password)); }
/** * Open a new XA connection using the current URL and the specified user * name and password. * * @param user the user name * @param password the password * @return the connection */ @Override public XAConnection getXAConnection(String user, String password) throws SQLException { if (isDebugEnabled()) { debugCode("getXAConnection("+quote(user)+", \"\");"); } int id = getNextId(XA_DATA_SOURCE); return new JdbcXAConnection(factory, id, getJdbcConnection(user, convertToCharArray(password))); }
/** * Set the current password in the form of a char array. * * @param password the new password in the form of a char array. */ public void setPasswordChars(char[] password) { if (isDebugEnabled()) { debugCode("setPasswordChars(new char[0]);"); } this.passwordChars = password; }
/** * Set the current password in the form of a char array. * * @param password the new password in the form of a char array. */ public void setPasswordChars(char[] password) { if (isDebugEnabled()) { debugCode("setPasswordChars(new char[0]);"); } this.passwordChars = password; }
private JdbcConnection getJdbcConnection(String user, char[] password) throws SQLException { if (isDebugEnabled()) { debugCode("getJdbcConnection("+quote(user)+", new char[0]);"); } Properties info = new Properties(); info.setProperty("user", user); info.put("password", password); Connection conn = Driver.load().connect(url, info); if (conn == null) { throw new SQLException("No suitable driver found for " + url, "08001", 8001); } else if (!(conn instanceof JdbcConnection)) { throw new SQLException( "Connecting with old version is not supported: " + url, "08001", 8001); } return (JdbcConnection) conn; }
private JdbcConnection getJdbcConnection(String user, char[] password) throws SQLException { if (isDebugEnabled()) { debugCode("getJdbcConnection("+quote(user)+", new char[0]);"); } Properties info = new Properties(); info.setProperty("user", user); info.put("password", password); Connection conn = Driver.load().connect(url, info); if (conn == null) { throw new SQLException("No suitable driver found for " + url, "08001", 8001); } else if (!(conn instanceof JdbcConnection)) { throw new SQLException( "Connecting with old version is not supported: " + url, "08001", 8001); } return (JdbcConnection) conn; }
/** * Open a new pooled connection using the current URL and the specified user * name and password. * * @param user the user name * @param password the password * @return the connection */ @Override public PooledConnection getPooledConnection(String user, String password) throws SQLException { if (isDebugEnabled()) { debugCode("getPooledConnection("+quote(user)+", \"\");"); } return getXAConnection(user, password); }
/** * Open a new pooled connection using the current URL and the specified user * name and password. * * @param user the user name * @param password the password * @return the connection */ @Override public PooledConnection getPooledConnection(String user, String password) throws SQLException { if (isDebugEnabled()) { debugCode("getPooledConnection("+quote(user)+", \"\");"); } return getXAConnection(user, password); }
/** * Open a new connection using the current URL and the specified user name * and password. * * @param user the user name * @param password the password * @return the connection */ @Override public Connection getConnection(String user, String password) throws SQLException { if (isDebugEnabled()) { debugCode("getConnection("+quote(user)+", \"\");"); } return getJdbcConnection(user, convertToCharArray(password)); }
/** * Open a new connection using the current URL and the specified user name * and password. * * @param user the user name * @param password the password * @return the connection */ @Override public Connection getConnection(String user, String password) throws SQLException { if (isDebugEnabled()) { debugCode("getConnection("+quote(user)+", \"\");"); } return getJdbcConnection(user, convertToCharArray(password)); }
/** * Open a new XA connection using the current URL and the specified user * name and password. * * @param user the user name * @param password the password * @return the connection */ @Override public XAConnection getXAConnection(String user, String password) throws SQLException { if (isDebugEnabled()) { debugCode("getXAConnection("+quote(user)+", \"\");"); } int id = getNextId(XA_DATA_SOURCE); return new JdbcXAConnection(factory, id, getJdbcConnection(user, convertToCharArray(password))); }
/** * Open a new XA connection using the current URL and the specified user * name and password. * * @param user the user name * @param password the password * @return the connection */ @Override public XAConnection getXAConnection(String user, String password) throws SQLException { if (isDebugEnabled()) { debugCode("getXAConnection("+quote(user)+", \"\");"); } int id = getNextId(XA_DATA_SOURCE); return new JdbcXAConnection(factory, id, getJdbcConnection(user, convertToCharArray(password))); }