• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

DBUtils是Apache提供的开源JDBC工具类库。它是JDBC的简易套装,学习成本极低。使用DBUtils可以大大简化JDBC编码的工作量,同时也不会影响程序的性能。

DBUtils的三个核心功能:

QueryRunner类,为sql语句操作提供API

ResultSetHandler接口用于定义在select操作之后如何打包结果集。

DbUtils类是一个工具类,它定义了关闭资源和处理事务的方法。

一、QueryRunner

QueryRunner中有六种方法:

执行(执行SQL语句)

批处理(批处理语句)

insert(执行INSERT语句)

insert batch(insert语句的批处理)

查询(SQL中的SELECT语句)

更新(SQL中的INSERT、Update或DELETE语句)

我们主要介绍后两种(最常用的):

Link to comment
Share on other sites