日期:2014-05-16 浏览次数:20444 次
这篇文章和前一篇的文章--------->第十七天3月12日之一句代码实现crud操作(手动写的,没使用其他jar包和框架)
所实现的功能差不多。这是第三方开发的,要导入相应的jar包(就一个jar包),比自己写的强大。强大之处在于结果集的处理。主要涉及的类是
org.apache.commons.dbutils
Class QueryRunner
API如下:
Constructor Summary | |
---|---|
QueryRunner()
Constructor for QueryRunner. |
|
QueryRunner(boolean pmdKnownBroken)
Constructor for QueryRunner, allows workaround for Oracle drivers |
|
QueryRunner(DataSource ds)
Constructor for QueryRunner which takes a DataSource . |
|
QueryRunner(DataSource ds,
boolean pmdKnownBroken) Constructor for QueryRunner, allows workaround for Oracle drivers. |
Method Summary | ||
---|---|---|
int[] |
batch(Connection conn,
String sql,
Object[][] params) Execute a batch of SQL INSERT, UPDATE, or DELETE queries. |
|
int[] |
batch(String sql,
Object[][] params) Execute a batch of SQL INSERT, UPDATE, or DELETE queries. |
|
|
query(Connection conn,
String sql,
Object[] params,
ResultSetHandler<T> rsh) Deprecated. Use query(Connection,String,ResultSetHandler,Object...) instead |
|
|
query(Connection conn,
String sql,
Object param,
ResultSetHandler<T> rsh) Deprecated. Use
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
|