用QueryRunner输出数据库中admin表具有的记录条数

导入dbutils.jar

@Test
public void test() throws SQLException {
String sql = “select count(*) from admin”;
QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSources());
long num = runner.query(sql, new ScalarHandler());
System.out.println(num);
}

上一篇:unittest框架


下一篇:[转]Gitlab-CI持续集成之Runner配置和CI脚本