Java Code Examples for org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer

The following examples show how to use org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer. These examples are extracted from open source projects. 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 Project: Tomcat8-Source-Read   Source File: StatementFinalizerTest.java    License: MIT License 5 votes vote down vote up
@Test
public void testStatementFinalization() throws Exception {
    datasource.setJdbcInterceptors(StatementFinalizer.class.getName());
    Connection con = datasource.getConnection();
    Statement st = con.createStatement();
    Assert.assertFalse("Statement should not be closed.",st.isClosed());
    con.close();
    Assert.assertTrue("Statement should be closed.",st.isClosed());
}
 
Example 2
Source Project: Tomcat7.0.67   Source File: StatementFinalizerTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testStatementFinalization() throws Exception {
    datasource.setJdbcInterceptors(StatementFinalizer.class.getName());
    Connection con = datasource.getConnection();
    Statement st = con.createStatement();
    Assert.assertFalse("Statement should not be closed.",st.isClosed());
    con.close();
    Assert.assertTrue("Statement should be closed.",st.isClosed());
}
 
Example 3
Source Project: tomcatsrc   Source File: StatementFinalizerTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testStatementFinalization() throws Exception {
    datasource.setJdbcInterceptors(StatementFinalizer.class.getName());
    Connection con = datasource.getConnection();
    Statement st = con.createStatement();
    Assert.assertFalse("Statement should not be closed.",st.isClosed());
    con.close();
    Assert.assertTrue("Statement should be closed.",st.isClosed());
}