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