use of cn.hutool.db.ds.dbcp.DbcpDSFactory in project hutool by looly.
the class DsTest method dbcpDsTest.
@Test
public void dbcpDsTest() throws SQLException {
DSFactory.setCurrentDSFactory(new DbcpDSFactory());
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.ds.dbcp.DbcpDSFactory in project hutool by looly.
the class DsTest method dbcpDsTest.
@Test
public void dbcpDsTest() throws SQLException {
DSFactory.setCurrentDSFactory(new DbcpDSFactory());
DataSource ds = DSFactory.get("test");
Db db = Db.use(ds);
List<Entity> all = db.findAll("user");
Assert.assertTrue(CollUtil.isNotEmpty(all));
}
Aggregations