Search in sources :

Example 6 with FBManagedConnectionFactory

use of org.firebirdsql.jaybird.xca.FBManagedConnectionFactory in project jaybird by FirebirdSQL.

the class DataSourceFactory method loadSimpleDS.

private Object loadSimpleDS(Reference ref) {
    RefAddr propertyContent = ref.get(FBSimpleDataSource.REF_MCF);
    FBManagedConnectionFactory mcf = null;
    if (propertyContent != null) {
        byte[] data = (byte[]) propertyContent.getContent();
        mcf = (FBManagedConnectionFactory) deserialize(data);
    }
    if (mcf == null) {
        mcf = new FBManagedConnectionFactory(false);
    }
    FBSimpleDataSource ds = new FBSimpleDataSource(mcf);
    ds.setDescription(getRefAddr(ref, FBSimpleDataSource.REF_DESCRIPTION));
    return ds;
}
Also used : FBManagedConnectionFactory(org.firebirdsql.jaybird.xca.FBManagedConnectionFactory)

Example 7 with FBManagedConnectionFactory

use of org.firebirdsql.jaybird.xca.FBManagedConnectionFactory in project jaybird by FirebirdSQL.

the class FBConnectionPoolDataSource method initialize.

private void initialize() throws SQLException {
    synchronized (lock) {
        if (internalDs != null) {
            return;
        }
        GDSType gdsType = GDSType.getType(getType());
        if (gdsType == null) {
            gdsType = GDSFactory.getDefaultGDSType();
        }
        FBManagedConnectionFactory mcf = new FBManagedConnectionFactory(gdsType, getConnectionProperties());
        internalDs = (FBDataSource) mcf.createConnectionFactory();
        internalDs.setLogWriter(getLogWriter());
    }
}
Also used : FBManagedConnectionFactory(org.firebirdsql.jaybird.xca.FBManagedConnectionFactory) GDSType(org.firebirdsql.gds.impl.GDSType)

Aggregations

FBManagedConnectionFactory (org.firebirdsql.jaybird.xca.FBManagedConnectionFactory)7 GDSType (org.firebirdsql.gds.impl.GDSType)3 Connection (java.sql.Connection)2 Test (org.junit.Test)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 FBTestProperties.getDefaultPropertiesForConnection (org.firebirdsql.common.FBTestProperties.getDefaultPropertiesForConnection)1 GDSException (org.firebirdsql.gds.GDSException)1 InvalidPropertyValueException (org.firebirdsql.jaybird.props.InvalidPropertyValueException)1 FirebirdConnection (org.firebirdsql.jdbc.FirebirdConnection)1