Java Code Examples for net.ttddyy.dsproxy.support.ProxyDataSource#setDataSource()

The following examples show how to use net.ttddyy.dsproxy.support.ProxyDataSource#setDataSource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExternalDataSourceConnectionProviderTest.java    From hibernate-master-class with Apache License 2.0 5 votes vote down vote up
protected ProxyDataSource newDataSource() {
    JDBCDataSource actualDataSource = new JDBCDataSource();
    actualDataSource.setUrl("jdbc:hsqldb:mem:test");
    actualDataSource.setUser("sa");
    actualDataSource.setPassword("");
    ProxyDataSource proxyDataSource = new ProxyDataSource();
    proxyDataSource.setDataSource(actualDataSource);
    proxyDataSource.setListener(new SLF4JQueryLoggingListener());
    return proxyDataSource;
}
 
Example 2
Source File: TransactionIsolationExternalDataSourceExternalconfgiurationConnectionProviderTest.java    From hibernate-master-class with Apache License 2.0 5 votes vote down vote up
protected ProxyDataSource newDataSource() {
    JDBCDataSource actualDataSource = new JDBCDataSource();
    actualDataSource.setUrl("jdbc:hsqldb:mem:test");
    actualDataSource.setUser("sa");
    actualDataSource.setPassword("");
    Properties properties = new Properties();
    properties.setProperty("hsqldb.tx_level", "SERIALIZABLE");
    actualDataSource.setProperties(properties);
    ProxyDataSource proxyDataSource = new ProxyDataSource();
    proxyDataSource.setDataSource(actualDataSource);
    proxyDataSource.setListener(new SLF4JQueryLoggingListener());
    return proxyDataSource;
}
 
Example 3
Source File: AbstractJPATest.java    From hibernate-master-class with Apache License 2.0 5 votes vote down vote up
private ProxyDataSource newDataSource() {
    JDBCDataSource actualDataSource = new JDBCDataSource();
    actualDataSource.setUrl("jdbc:hsqldb:mem:test");
    actualDataSource.setUser("sa");
    actualDataSource.setPassword("");
    ProxyDataSource proxyDataSource = new ProxyDataSource();
    proxyDataSource.setDataSource(actualDataSource);
    proxyDataSource.setListener(new SLF4JQueryLoggingListener());
    return proxyDataSource;
}
 
Example 4
Source File: QuickPerfSqlDataSourceBuilder.java    From quickperf with Apache License 2.0 4 votes vote down vote up
public ProxyDataSource buildProxy(DataSource dataSource) {

        ProxyDataSource proxyDataSource = new ProxyDataSource();

        ChainListener chainListener = new ChainListener();

        DataSourceQuickPerfListener dataSourceQuickPerfListener = new DataSourceQuickPerfListener();
        chainListener.addListener(dataSourceQuickPerfListener);

        proxyDataSource.addListener(chainListener);

        proxyDataSource.setDataSource(dataSource);

        return proxyDataSource;

    }