DataSource dataSource = getDataSource(); if (dataSource == null) { try { dataSource = (DataSource)getContext().lookup(getName()); } else if (lookupType == COMPOSITE_NAME_LOOKUP) { dataSource = (DataSource)getContext().lookup(new CompositeName(name)); } else { dataSource = (DataSource)getContext().lookup(new CompoundName(name, new Properties())); this.setDataSource(dataSource); } catch (NamingException exception) { throw ValidationException.cannotAcquireDataSource(getName(), exception);
/** * INTERNAL: * Connect with the specified properties and session. Return the Connection. */ public Connection connect(Properties properties, Session session) throws DatabaseException, ValidationException { return connect(properties); }
if (oldJNDIConnector != null) { if (dataSource != null) { if (!dataSource.equals(oldJNDIConnector.getDataSource())) { isNewDataSourceRequired = Boolean.TRUE; if (!dataSourceName.equals(oldJNDIConnector.getName())) { isNewDataSourceRequired = Boolean.TRUE; newLogin.setUsesExternalConnectionPooling(false); } else if (isNewJNDIConnectorRequired) { newLogin.setConnector(new JNDIConnector()); newLogin.setUsesExternalConnectionPooling(true); if (isNewDataSourceRequired) { if (dataSource != null) { jndiConnector.setDataSource(dataSource); } else { jndiConnector.setName(dataSourceName);
if (datasourceName != null) { try { JNDIConnector jndiConnector = new JNDIConnector(new javax.naming.InitialContext(), datasourceName); jndiConnector.setLookupType(databaseLoginConfig.getLookupType().intValue()); databaseLogin.setConnector(jndiConnector); } catch (Exception exception) {
/** * PUBLIC: * Specify the J2EE DataSource name to connect to. * Also enable external connection pooling. * @see JNDIConnector */ public void useDataSource(String dataSource) { setConnector(new JNDIConnector(dataSource)); useExternalConnectionPooling(); }
/** * PUBLIC: * Provide the details of my connection information. This is primarily for JMX runtime services. * @return java.lang.String */ public String getConnectionDetails() { return getName(); }
/** * {@inheritDoc} */ @Override public Object getGeneratedValue(Accessor accessor, AbstractSession writeSession, String seqName) { DataSource dataSource = ((JNDIConnector) writeSession.getLogin().getConnector()).getDataSource(); DataFieldMaxValueIncrementer incrementer = MaxValueIncrementerFactory.getIncrementer(dataSource, sequenceName); return Long.valueOf(incrementer.nextLongValue()); }
if (datasourceName != null) { try { JNDIConnector jndiConnector = new JNDIConnector(new javax.naming.InitialContext(), datasourceName); jndiConnector.setLookupType(databaseLoginConfig.getLookupType().intValue()); databaseLogin.setConnector(jndiConnector); } catch (Exception exception) {
/** * PUBLIC: * Specify the J2EE DataSource name to connect to. * Also enable external connection pooling. * @see JNDIConnector */ public void useDataSource(String dataSource) { setConnector(new JNDIConnector(dataSource)); useExternalConnectionPooling(); }
/** * PUBLIC: * Provide the details of my connection information. This is primarily for JMX runtime services. * @return java.lang.String */ public String getConnectionDetails() { return getName(); }
DataSource dataSource = getDataSource(); if (dataSource == null) { try { dataSource = (DataSource)getContext().lookup(getName()); } else if (type == COMPOSITE_NAME_LOOKUP) { dataSource = (DataSource)getContext().lookup(new CompositeName(name)); } else { dataSource = (DataSource)getContext().lookup(new CompoundName(name, new Properties())); this.setDataSource(dataSource); } catch (NamingException exception) { throw ValidationException.cannotAcquireDataSource(getName(), exception);
if (datasourceName != null) { try { JNDIConnector jndiConnector = new JNDIConnector(new javax.naming.InitialContext(), datasourceName); jndiConnector.setLookupType(databaseLoginConfig.getLookupType().intValue()); databaseLogin.setConnector(jndiConnector); } catch (Exception exception) {
/** * PUBLIC: * Specify the J2EE DataSource name to connect to. * Also enable external connection pooling. * @see JNDIConnector */ public void useDataSource(String dataSource) { setConnector(new JNDIConnector(dataSource)); useExternalConnectionPooling(); }
/** * PUBLIC: * Provide the details of my connection information. This is primarily for JMX runtime services. * @return java.lang.String */ public String getConnectionDetails() { return getName(); }
/** * 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(); } } } }
DataSource dataSource = getDataSource(); if (dataSource == null) { try { dataSource = (DataSource)getContext().lookup(getName()); } else if (type == COMPOSITE_NAME_LOOKUP) { dataSource = (DataSource)getContext().lookup(new CompositeName(name)); } else { dataSource = (DataSource)getContext().lookup(new CompoundName(name, new Properties())); this.setDataSource(dataSource); } catch (NamingException exception) { throw ValidationException.cannotAcquireDataSource(getName(), exception);
config.addDataSourceProperty("maintainTimeStats", "false"); login.setConnector(new JNDIConnector(new HikariDataSource(config))); login.useExternalConnectionPooling();
/** * INTERNAL: * Print something useful on the log. */ public void toString(java.io.PrintWriter writer) { writer.print(ToStringLocalization.buildMessage("connector", (Object[])null) + "=>" + Helper.getShortClassName(getClass())); writer.print(" "); writer.println(ToStringLocalization.buildMessage("datasource_name", (Object[])null) + "=>" + getName()); } }
/** * 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(); } } } }
if (mainDatasource instanceof DataSourceImpl) { jndiConnector = new JNDIConnector(((DataSourceImpl)mainDatasource).getName()); } else { jndiConnector = new JNDIConnector(mainDatasource); if (readDatasource instanceof DataSourceImpl) { jndiConnector = new JNDIConnector(((DataSourceImpl)readDatasource).getName()); } else { jndiConnector = new JNDIConnector(readDatasource);