use of com.alibaba.druid.proxy.jdbc.ClobProxy in project druid by alibaba.
the class StatFilterClobTest method test_clob.
public void test_clob() throws Exception {
String sql = "select ?";
Connection conn = dataSource.getConnection();
PreparedStatement stmt = conn.prepareStatement(sql);
MockClob clob = new MockClob();
stmt.setClob(1, clob);
ResultSet rs = stmt.executeQuery();
rs.next();
Assert.assertTrue(rs.getObject(1) instanceof ClobProxy);
rs.close();
stmt.close();
conn.close();
JdbcSqlStat sqlStat = dataSource.getDataSourceStat().getSqlStat(sql);
Assert.assertNotNull(sqlStat);
Assert.assertEquals(1, sqlStat.getClobOpenCount());
sqlStat.reset();
Assert.assertEquals(0, sqlStat.getClobOpenCount());
}
use of com.alibaba.druid.proxy.jdbc.ClobProxy in project druid by alibaba.
the class FilterChainTest_Clob method test_resultSet_getObject_1.
public void test_resultSet_getObject_1() throws Exception {
FilterChainImpl chain = new FilterChainImpl(dataSource);
Clob clob = (Clob) chain.resultSet_getObject(new ResultSetProxyImpl(statement, mockResultSet, 1, null), "1");
Assert.assertTrue(clob instanceof ClobProxy);
Assert.assertEquals(1, invokeCount);
}
use of com.alibaba.druid.proxy.jdbc.ClobProxy in project druid by alibaba.
the class FilterChainTest_Clob method test_resultSet_getClob.
public void test_resultSet_getClob() throws Exception {
FilterChainImpl chain = new FilterChainImpl(dataSource);
Clob clob = chain.resultSet_getClob(new ResultSetProxyImpl(statement, mockResultSet, 1, null), 1);
Assert.assertTrue(clob instanceof ClobProxy);
Assert.assertEquals(1, invokeCount);
}
use of com.alibaba.druid.proxy.jdbc.ClobProxy in project druid by alibaba.
the class FilterChainTest_Clob method test_resultSet_getObject_2.
public void test_resultSet_getObject_2() throws Exception {
FilterChainImpl chain = new FilterChainImpl(dataSource);
Clob clob = (Clob) chain.resultSet_getObject(new ResultSetProxyImpl(statement, mockResultSet, 1, null), 1, Collections.<String, Class<?>>emptyMap());
Assert.assertTrue(clob instanceof ClobProxy);
Assert.assertEquals(1, invokeCount);
}
Aggregations