throw ValidationException.cannotAcquireDataSource(getName(), exception);
/** * 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(); } } } }
throw ValidationException.cannotAcquireDataSource(getName(), exception);
/** * 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(); } } } }
throw ValidationException.cannotAcquireDataSource(getName(), exception);
/** * Connect with the specified properties and return the Connection. */ public Connection connectToDataSource(EISAccessor accessor, Properties properties) throws DatabaseException, ValidationException { ConnectionFactory connectionFactory = getConnectionFactory(); if (connectionFactory == null) { try { connectionFactory = (ConnectionFactory)getContext().lookup(getName()); setConnectionFactory(connectionFactory); } catch (Exception exception) { throw ValidationException.cannotAcquireDataSource(getName(), exception); } } try { accessor.setRecordFactory(connectionFactory.getRecordFactory()); if (getConnectionSpec() == null) { return connectionFactory.getConnection(); } else { return connectionFactory.getConnection(getConnectionSpec()); } } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Connect with the specified properties and return the Connection. */ public Connection connectToDataSource(EISAccessor accessor, Properties properties) throws DatabaseException, ValidationException { ConnectionFactory connectionFactory = getConnectionFactory(); if (connectionFactory == null) { try { connectionFactory = (ConnectionFactory)getContext().lookup(getName()); setConnectionFactory(connectionFactory); } catch (Exception exception) { throw ValidationException.cannotAcquireDataSource(getName(), exception); } } try { accessor.setRecordFactory(connectionFactory.getRecordFactory()); if (getConnectionSpec() == null) { return connectionFactory.getConnection(); } else { return connectionFactory.getConnection(getConnectionSpec()); } } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Connect with the specified properties and return the Connection. */ public Connection connectToDataSource(EISAccessor accessor, Properties properties) throws DatabaseException, ValidationException { ConnectionFactory connectionFactory = getConnectionFactory(); if (connectionFactory == null) { try { connectionFactory = (ConnectionFactory)getContext().lookup(getName()); setConnectionFactory(connectionFactory); } catch (Exception exception) { throw ValidationException.cannotAcquireDataSource(getName(), exception); } } try { accessor.setRecordFactory(connectionFactory.getRecordFactory()); if (getConnectionSpec() == null) { return connectionFactory.getConnection(); } else { return connectionFactory.getConnection(getConnectionSpec()); } } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }