use of com.alibaba.druid.util.JdbcUtils in project druid by alibaba.
the class JdbcUtilsTest method test_close.
public void test_close() throws Exception {
JdbcUtils.close((Connection) null);
JdbcUtils.close((Statement) null);
JdbcUtils.close((ResultSet) null);
JdbcUtils.close(new MockConnection() {
@Override
public void close() throws SQLException {
throw new SQLException();
}
});
JdbcUtils.close(new MockStatement(null) {
@Override
public void close() throws SQLException {
throw new SQLException();
}
});
JdbcUtils.close(new MockResultSet(null) {
@Override
public void close() throws SQLException {
throw new SQLException();
}
});
JdbcUtils.close(new Closeable() {
@Override
public void close() throws IOException {
throw new IOException();
}
});
JdbcUtils.close(new Closeable() {
@Override
public void close() throws IOException {
}
});
JdbcUtils.close((Closeable) null);
new JdbcUtils();
}
Aggregations