Search in sources :

Example 1 with DelegatingDataSource

use of org.springframework.jdbc.datasource.DelegatingDataSource in project iaf by ibissource.

the class NarayanaXADataSourceFactory method augmentXADataSource.

@Override
protected DataSource augmentXADataSource(XADataSource xaDataSource, String product) {
    return new // Cannot use NarayanaDatasource as the PGSQL driver does not implement the Datasource interface
    DelegatingDataSource() {

        @Override
        public Connection getConnection() throws SQLException {
            Properties properties = new Properties();
            properties.put(TransactionalDriver.XADataSource, xaDataSource);
            properties.setProperty(TransactionalDriver.poolConnections, "true");
            properties.setProperty(TransactionalDriver.maxConnections, "100");
            return ConnectionManager.create(null, properties);
        }
    };
}
Also used : Properties(java.util.Properties) DelegatingDataSource(org.springframework.jdbc.datasource.DelegatingDataSource)

Aggregations

Properties (java.util.Properties)1 DelegatingDataSource (org.springframework.jdbc.datasource.DelegatingDataSource)1