use of cn.hutool.db.SqlRunner in project hutool by looly.
the class DsTest method hutoolPoolTest.
@Test
public void hutoolPoolTest() throws SQLException {
DSFactory.setCurrentDSFactory(new PooledDSFactory());
DataSource ds = DSFactory.get();
SqlRunner runner = SqlRunner.create(ds);
List<Entity> all = runner.findAll("user");
Assert.assertTrue(CollUtil.isNotEmpty(all));
}
use of cn.hutool.db.SqlRunner in project hutool by looly.
the class DsTest method hikariDsTest.
@Test
public void hikariDsTest() throws SQLException {
DSFactory.setCurrentDSFactory(new HikariDSFactory());
DataSource ds = DSFactory.get();
SqlRunner runner = SqlRunner.create(ds);
List<Entity> all = runner.findAll("user");
Assert.assertTrue(CollUtil.isNotEmpty(all));
}
Aggregations