use of cn.hutool.db.SqlRunner in project hutool by looly.
the class DsTest method c3p0DsTest.
@Test
public void c3p0DsTest() throws SQLException {
DSFactory.setCurrentDSFactory(new C3p0DSFactory());
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 defaultDsTest.
@Test
public void defaultDsTest() throws SQLException {
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 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.SqlRunner in project hutool by looly.
the class DsTest method tomcatDsTest.
@Test
public void tomcatDsTest() throws SQLException {
DSFactory.setCurrentDSFactory(new TomcatDSFactory());
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 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