在百度搜索dbutils maven 复制他的依赖并将其放到pom配置文件中。
**<dependency>
<groupId>commons-dbutils</groupId>
<artifactId>commons-dbutils</artifactId>
<version>1.7</version>
</dependency>**
这个框架主要执行语句:
public static void main(String[] args) {
QueryRunner runner = new QueryRunner(JDBCUtils.getDataSource());
String sql = "select * from week_plan_son179_jianli";
try {
List list = runner.query(sql, new BeanListHandler(WeekPlan.class));
System.out.println(list);
for (Object object : list) {
System.out.println(list);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}