Search in sources :

Example 1 with PooledDataSource

use of com.cadenzauk.core.sql.testutil.PooledDataSource in project siesta by cadenzauk.

the class Db2Config method dataSource.

@Bean
public DataSource dataSource() throws SQLException {
    DB2ConnectionPoolDataSource pool = new DB2ConnectionPoolDataSource();
    pool.setDatabaseName("SIESTA");
    pool.setDriverType(2);
    pool.setConcurrentAccessResolution(1);
    return new PooledDataSource(pool);
}
Also used : DB2ConnectionPoolDataSource(com.ibm.db2.jcc.DB2ConnectionPoolDataSource) PooledDataSource(com.cadenzauk.core.sql.testutil.PooledDataSource) Bean(org.springframework.context.annotation.Bean)

Example 2 with PooledDataSource

use of com.cadenzauk.core.sql.testutil.PooledDataSource in project siesta by cadenzauk.

the class SqlServerConfig method dataSource.

@Bean
public DataSource dataSource() throws SQLException {
    SQLServerConnectionPoolDataSource pool = new SQLServerConnectionPoolDataSource();
    pool.setServerName("localhost\\SQLEXPRESS");
    pool.setDatabaseName("SIESTA");
    pool.setIntegratedSecurity(true);
    return new PooledDataSource(pool);
}
Also used : SQLServerConnectionPoolDataSource(com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource) PooledDataSource(com.cadenzauk.core.sql.testutil.PooledDataSource) Bean(org.springframework.context.annotation.Bean)

Example 3 with PooledDataSource

use of com.cadenzauk.core.sql.testutil.PooledDataSource in project siesta by cadenzauk.

the class PostgresConfig method dataSource.

@Bean
public DataSource dataSource() throws SQLException {
    PGConnectionPoolDataSource pool = new PGConnectionPoolDataSource();
    pool.setUser("siesta");
    pool.setDatabaseName("postgres");
    return new PooledDataSource(pool);
}
Also used : PGConnectionPoolDataSource(org.postgresql.ds.PGConnectionPoolDataSource) PooledDataSource(com.cadenzauk.core.sql.testutil.PooledDataSource) Bean(org.springframework.context.annotation.Bean)

Example 4 with PooledDataSource

use of com.cadenzauk.core.sql.testutil.PooledDataSource in project siesta by cadenzauk.

the class OracleConfig method dataSource.

@Bean
public DataSource dataSource() throws SQLException {
    OracleConnectionPoolDataSource pool = new OracleConnectionPoolDataSource();
    pool.setUser("siesta");
    pool.setPassword("siesta");
    pool.setURL("jdbc:oracle:thin:@127.0.0.1:1521:xe");
    return new PooledDataSource(pool, "ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'");
}
Also used : OracleConnectionPoolDataSource(oracle.jdbc.pool.OracleConnectionPoolDataSource) PooledDataSource(com.cadenzauk.core.sql.testutil.PooledDataSource) Bean(org.springframework.context.annotation.Bean)

Example 5 with PooledDataSource

use of com.cadenzauk.core.sql.testutil.PooledDataSource in project siesta by cadenzauk.

the class FirebirdConfig method dataSource.

@Bean
public DataSource dataSource() throws SQLException {
    FBConnectionPoolDataSource pool = new FBConnectionPoolDataSource();
    pool.setServerName("localhost");
    pool.setUser("SIESTA");
    pool.setPassword("siesta");
    pool.setDatabaseName("siesta");
    pool.setCharSet("utf-8");
    return new PooledDataSource(pool);
}
Also used : FBConnectionPoolDataSource(org.firebirdsql.ds.FBConnectionPoolDataSource) PooledDataSource(com.cadenzauk.core.sql.testutil.PooledDataSource) Bean(org.springframework.context.annotation.Bean)

Aggregations

PooledDataSource (com.cadenzauk.core.sql.testutil.PooledDataSource)5 Bean (org.springframework.context.annotation.Bean)5 DB2ConnectionPoolDataSource (com.ibm.db2.jcc.DB2ConnectionPoolDataSource)1 SQLServerConnectionPoolDataSource (com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource)1 OracleConnectionPoolDataSource (oracle.jdbc.pool.OracleConnectionPoolDataSource)1 FBConnectionPoolDataSource (org.firebirdsql.ds.FBConnectionPoolDataSource)1 PGConnectionPoolDataSource (org.postgresql.ds.PGConnectionPoolDataSource)1