use of com.alibaba.druid.proxy.jdbc.ConnectionProxy in project druid by alibaba.
the class DruidDataSourceTest_autocommit3 method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setTestOnBorrow(false);
dataSource.setDefaultAutoCommit(false);
dataSource.setInitialSize(1);
dataSource.getProxyFilters().add(new FilterAdapter() {
public ConnectionProxy connection_connect(FilterChain chain, Properties info) throws SQLException {
ConnectionProxy conn = chain.connection_connect(info);
conn.setAutoCommit(false);
return conn;
}
});
}
use of com.alibaba.druid.proxy.jdbc.ConnectionProxy in project druid by alibaba.
the class DruidDataSourceTest_closeError method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setTestOnBorrow(false);
dataSource.setInitialSize(1);
dataSource.getProxyFilters().add(new FilterAdapter() {
public void connection_close(FilterChain chain, ConnectionProxy connection) throws SQLException {
throw new SQLException();
}
});
dataSource.init();
}
use of com.alibaba.druid.proxy.jdbc.ConnectionProxy in project druid by alibaba.
the class DruidDataSourceTest_lastCreateError method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setTestOnBorrow(false);
dataSource.getProxyFilters().add(new FilterAdapter() {
public ConnectionProxy connection_connect(FilterChain chain, Properties info) throws SQLException {
throw new SQLException();
}
});
}
use of com.alibaba.druid.proxy.jdbc.ConnectionProxy in project druid by alibaba.
the class DruidDataSourceTest7 method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setInitialSize(1);
dataSource.getProxyFilters().add(new FilterAdapter() {
@Override
public ConnectionProxy connection_connect(FilterChain chain, Properties info) throws SQLException {
throw new RuntimeException();
}
});
}
use of com.alibaba.druid.proxy.jdbc.ConnectionProxy in project druid by alibaba.
the class DruidDataSourceTest_recycle2 method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setTestOnBorrow(false);
dataSource.getProxyFilters().add(new FilterAdapter() {
public void connection_rollback(FilterChain chain, ConnectionProxy connection) throws SQLException {
throw new SQLException();
}
});
}
Aggregations