private final JDBC2RecoveryConnection getConnection () throws SQLException { if (connections[connectionIndex] == null) { String number = new String(""+ (connectionIndex + 1)); String url = new String(dbTag + number + urlTag); String password = new String(dbTag + number + passwordTag); String user = new String(dbTag + number + userTag); String dynamicClass = new String(dbTag + number + dynamicClassTag); Properties dbProperties = new Properties(); String theUser = props.getProperty(user); String thePassword = props.getProperty(password); String theURL = props.getProperty(url); if (theUser != null) { dbProperties.put(TransactionalDriver.userName, theUser); dbProperties.put(TransactionalDriver.password, thePassword); String dc = props.getProperty(dynamicClass); if (dc != null) dbProperties.put(TransactionalDriver.dynamicClass, dc); JDBC2RecoveryConnection connection = new JDBC2RecoveryConnection(theURL, dbProperties); connections[connectionIndex] = connection; return connection; } else { jdbcLogger.i18NLogger.warn_recovery_basic_xarec("BasicXARecovery.getConnection -"); throw new SQLException(jdbcLogger.i18NLogger.insufficientConnectionInformation()); } } return connections[connectionIndex]; }
private final JDBC2RecoveryConnection getConnection () throws SQLException { if (connections[connectionIndex] == null) { String number = new String(""+ (connectionIndex + 1)); String url = new String(dbTag + number + urlTag); String password = new String(dbTag + number + passwordTag); String user = new String(dbTag + number + userTag); String dynamicClass = new String(dbTag + number + dynamicClassTag); Properties dbProperties = new Properties(); String theUser = props.getProperty(user); String thePassword = props.getProperty(password); String theURL = props.getProperty(url); if (theUser != null) { dbProperties.put(TransactionalDriver.userName, theUser); dbProperties.put(TransactionalDriver.password, thePassword); String dc = props.getProperty(dynamicClass); if (dc != null) dbProperties.put(TransactionalDriver.dynamicClass, dc); JDBC2RecoveryConnection connection = new JDBC2RecoveryConnection(theURL, dbProperties); connections[connectionIndex] = connection; return connection; } else { jdbcLogger.i18NLogger.warn_recovery_basic_xarec("BasicXARecovery.getConnection -"); throw new SQLException(jdbcLogger.i18NLogger.insufficientConnectionInformation()); } } return connections[connectionIndex]; }
private final JDBC2RecoveryConnection getConnection () throws SQLException { if (connections[connectionIndex] == null) { String number = new String(""+ (connectionIndex + 1)); String url = new String(dbTag + number + urlTag); String password = new String(dbTag + number + passwordTag); String user = new String(dbTag + number + userTag); String dynamicClass = new String(dbTag + number + dynamicClassTag); Properties dbProperties = new Properties(); String theUser = props.getProperty(user); String thePassword = props.getProperty(password); String theURL = props.getProperty(url); if (theUser != null) { dbProperties.put(TransactionalDriver.userName, theUser); dbProperties.put(TransactionalDriver.password, thePassword); String dc = props.getProperty(dynamicClass); if (dc != null) dbProperties.put(TransactionalDriver.dynamicClass, dc); JDBC2RecoveryConnection connection = new JDBC2RecoveryConnection(theURL, dbProperties); connections[connectionIndex] = connection; return connection; } else { jdbcLogger.i18NLogger.warn_recovery_basic_xarec("BasicXARecovery.getConnection -"); throw new SQLException(jdbcLogger.i18NLogger.insufficientConnectionInformation()); } } return connections[connectionIndex]; }
private final JDBC2RecoveryConnection getConnection () throws SQLException { if (connections[connectionIndex] == null) { String number = new String(""+ (connectionIndex + 1)); String url = new String(dbTag + number + urlTag); String password = new String(dbTag + number + passwordTag); String user = new String(dbTag + number + userTag); String dynamicClass = new String(dbTag + number + dynamicClassTag); Properties dbProperties = new Properties(); String theUser = props.getProperty(user); String thePassword = props.getProperty(password); String theURL = props.getProperty(url); if (theUser != null) { dbProperties.put(TransactionalDriver.userName, theUser); dbProperties.put(TransactionalDriver.password, thePassword); String dc = props.getProperty(dynamicClass); if (dc != null) dbProperties.put(TransactionalDriver.dynamicClass, dc); JDBC2RecoveryConnection connection = new JDBC2RecoveryConnection(theURL, dbProperties); connections[connectionIndex] = connection; return connection; } else { jdbcLogger.i18NLogger.warn_recovery_basic_xarec("BasicXARecovery.getConnection -"); throw new SQLException(jdbcLogger.i18NLogger.insufficientConnectionInformation()); } } return connections[connectionIndex]; }
public synchronized XAResource getXAResource () throws SQLException { JDBC2RecoveryConnection conn = null; if (hasMoreResources()) { connectionIndex++; conn = getConnection(); if (conn == null) { jdbcLogger.i18NLogger.warn_recovery_basic_xarec("BasicXARecovery.getConnection -"); } } return conn.recoveryConnection().getConnection().getXAResource(); }
public synchronized XAResource getXAResource () throws SQLException { JDBC2RecoveryConnection conn = null; if (hasMoreResources()) { connectionIndex++; conn = getConnection(); if (conn == null) { jdbcLogger.i18NLogger.warn_recovery_basic_xarec("BasicXARecovery.getConnection -"); } } return conn.recoveryConnection().getConnection().getXAResource(); }