/** * INTERNAL: * In case "proxytype" property is specified connects using proxy connection, * otherwise calls its superclass. */ public Connection connect(Properties properties, Session session) throws DatabaseException, ValidationException { String proxytype = properties.getProperty(OracleOCIConnectionPool.PROXYTYPE); if(proxytype == null || proxytype.length() == 0) { return super.connect(properties, session); } else { try { OracleOCIConnectionPool oracleOCIConnectionPool = (OracleOCIConnectionPool)getDataSource(); if (oracleOCIConnectionPool == null) { try { oracleOCIConnectionPool = (OracleOCIConnectionPool)getContext().lookup(getName()); this.setDataSource(oracleOCIConnectionPool); } catch (NamingException exception) { throw ValidationException.cannotAcquireDataSource(getName(), exception); } } return oracleOCIConnectionPool.getProxyConnection(proxytype, properties); } catch (SQLException exception) { throw DatabaseException.sqlException(exception, true); } catch (ClassCastException classCastException) { throw ValidationException.oracleOCIProxyConnectorRequiresOracleOCIConnectionPool(); } } } }
/** * INTERNAL: * In case "proxytype" property is specified connects using proxy connection, * otherwise calls its superclass. */ public Connection connect(Properties properties, Session session) throws DatabaseException, ValidationException { String proxytype = properties.getProperty(OracleOCIConnectionPool.PROXYTYPE); if(proxytype == null || proxytype.length() == 0) { return super.connect(properties, session); } else { try { OracleOCIConnectionPool oracleOCIConnectionPool = (OracleOCIConnectionPool)getDataSource(); if (oracleOCIConnectionPool == null) { try { oracleOCIConnectionPool = (OracleOCIConnectionPool)getContext().lookup(getName()); this.setDataSource(oracleOCIConnectionPool); } catch (NamingException exception) { throw ValidationException.cannotAcquireDataSource(getName(), exception); } } return oracleOCIConnectionPool.getProxyConnection(proxytype, properties); } catch (SQLException exception) { throw DatabaseException.sqlException(exception, true); } catch (ClassCastException classCastException) { throw ValidationException.oracleOCIProxyConnectorRequiresOracleOCIConnectionPool(); } } } }