use of com.alibaba.druid.pool.vendor.OracleExceptionSorter in project druid by alibaba.
the class OracleExceptionSorterTest_stmt_setQueryTimeout method setUp.
protected void setUp() throws Exception {
Assert.assertEquals(0, JdbcStatManager.getInstance().getSqlList().size());
dataSource = new DruidDataSource();
dataSource.setExceptionSorter(new OracleExceptionSorter());
dataSource.setDriver(new OracleMockDriver());
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setPoolPreparedStatements(true);
dataSource.setMaxOpenPreparedStatements(100);
}
use of com.alibaba.druid.pool.vendor.OracleExceptionSorter in project druid by alibaba.
the class OracleExceptionSorter_userDefined method test_userDefinedErrorCodes.
public void test_userDefinedErrorCodes() throws Exception {
OracleExceptionSorter sorter = new OracleExceptionSorter();
Assert.assertEquals(3, sorter.getFatalErrorCodes().size());
Assert.assertTrue(sorter.getFatalErrorCodes().contains(1));
Assert.assertTrue(sorter.getFatalErrorCodes().contains(2));
Assert.assertTrue(sorter.getFatalErrorCodes().contains(3));
Assert.assertTrue(sorter.isExceptionFatal(new SQLException("xx", "xx", 1)));
Assert.assertTrue(sorter.isExceptionFatal(new SQLException("xx", "xx", 2)));
Assert.assertTrue(sorter.isExceptionFatal(new SQLException("xx", "xx", 3)));
Assert.assertFalse(sorter.isExceptionFatal(new SQLException("xx", "xx", 4)));
Assert.assertTrue(sorter.isExceptionFatal(new SQLException("xx", "xx", 28)));
}
use of com.alibaba.druid.pool.vendor.OracleExceptionSorter in project druid by alibaba.
the class OracleExceptionSorterTest_stmt_executeUpdate_3 method setUp.
protected void setUp() throws Exception {
Assert.assertEquals(0, JdbcStatManager.getInstance().getSqlList().size());
dataSource = new DruidDataSource();
dataSource.setExceptionSorter(new OracleExceptionSorter());
dataSource.setDriver(new OracleMockDriver());
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setPoolPreparedStatements(true);
dataSource.setMaxOpenPreparedStatements(100);
}
use of com.alibaba.druid.pool.vendor.OracleExceptionSorter in project druid by alibaba.
the class OracleExceptionSorterTest_stmt_execute_1 method setUp.
protected void setUp() throws Exception {
Assert.assertEquals(0, JdbcStatManager.getInstance().getSqlList().size());
dataSource = new DruidDataSource();
dataSource.setExceptionSorter(new OracleExceptionSorter());
dataSource.setDriver(new OracleMockDriver());
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setPoolPreparedStatements(true);
dataSource.setMaxOpenPreparedStatements(100);
}
use of com.alibaba.druid.pool.vendor.OracleExceptionSorter in project druid by alibaba.
the class OracleExceptionSorterTest_stmt_execute_2 method setUp.
protected void setUp() throws Exception {
Assert.assertEquals(0, JdbcStatManager.getInstance().getSqlList().size());
dataSource = new DruidDataSource();
dataSource.setExceptionSorter(new OracleExceptionSorter());
dataSource.setDriver(new OracleMockDriver());
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setPoolPreparedStatements(true);
dataSource.setMaxOpenPreparedStatements(100);
}
Aggregations