PooledConnectionAndInfo info = null;
try {
info = getPooledConnectionAndInfo(username, password);
} catch (NoSuchElementException e) {
closeDueToException(info);
throw new SQLNestedException("Cannot borrow connection from pool", e);
} catch (RuntimeException e) {
closeDueToException(info);
throw e;
} catch (SQLException e) {
closeDueToException(info);
throw e;
} catch (Exception e) {
closeDueToException(info);
throw new SQLNestedException("Cannot borrow connection from pool", e);
}
if (!(null == password ? null == info.getPassword()
: password.equals(info.getPassword()))) {
closeDueToException(info);