apache-comnons系列之commons-dbutils1.7 学习笔记
来源:互联网 发布:dcp打包软件 编辑:程序博客网 时间:2024/06/08 09:32
apache-comnons系列之commons-dbutils1.7 学习笔记
概述
- 参考
- http://blog.csdn.net/imust_can/article/details/7005972
- DbUtils
- A collection of JDBC helper methods. This class is thread safe.
- QueryRunner
- Executes SQL queries with pluggable strategies for handling
ResultSet
s. This class is thread safe
- Executes SQL queries with pluggable strategies for handling
- QueryLoader
QueryLoader
is a registry for sets of queries so that multiple copies of the same queries aren’t loaded into memory.- This implementation loads properties files filled with query name to SQL mappings. This class is thread safe.
- ResultSetHandler
- Implementations of this interface convert ResultSets into other objects.
- org.apache.commons.dbutils.handlers.ArrayHandler
- return rs.next() ? this.convert.toArray(rs) : EMPTY_ARRAY;
- org.apache.commons.dbutils.handlers.BeanListHandler
- ResultSetHandler implementation that converts a
ResultSet
into aList
of beans. This class is thread safe.
- ResultSetHandler implementation that converts a
- org.apache.commons.dbutils.handlers.MapHandler
ResultSetHandler
implementation that converts the firstResultSet
row into aMap
. This class is thread
- RowProcessor
- RowProcessor implementations convert
ResultSet
rows into various other objects. Implementations can extendBasicRowProcessor
to protect themselves from changes to this interface
- RowProcessor implementations convert
- BasicRowProcessor
- toArray
- toBean
- toMap
- ColumnHandler
- Interface to define how implementations can interact with column handling when constructing a bean from a{@link java.sql.ResultSet}. ColumnHandlers do the work of retrieving data correctly from the
ResultSet
. - match
- apply
- Interface to define how implementations can interact with column handling when constructing a bean from a{@link java.sql.ResultSet}. ColumnHandlers do the work of retrieving data correctly from the
- StringTrimmedResultSet
- Wraps a
ResultSet
to trim strings returned by thegetString()
andgetObject()
methods. - type.cast(Proxy.newProxyInstance(handler.getClass().getClassLoader(), new Class
- Wraps a
测试
- org.apache.commons.dbutils.DbUtilsTest
- closeQuietly
- Close a
Connection
,Statement
andResultSet
. Avoid closing if null and hide any SQLExceptions that occur.
- Close a
- commitAndCloseQuietly
- Commits a
Connection
then closes it, avoid closing if null and hide any SQLExceptions that occur
- Commits a
- rollbackAndCloseQuietly
- Performs a rollback on the
Connection
then closes it,avoid closing if null and hide any SQLExceptions that occur
- Performs a rollback on the
- loadDriver
- Loads and registers a database driver class.If this succeeds, it returns true, else it returns false
- closeQuietly
- org.apache.commons.dbutils.QueryRunnerTest
- query
- Calls query after checking the parameters to ensure nothing is null.
- update
- Execute an SQL INSERT, UPDATE, or DELETE query with a single replacement parameter
- insert
- Executes the given INSERT SQL statement.
- query
- org.apache.commons.dbutils.QueryLoaderTest
- load
- Loads a Map of query names to SQL values. The Maps are cached so a
- subsequent request to load queries from the same path will return
- the cached Map. The properties file to load can be in either
- line-oriented or XML format. XML formatted properties files must use a
.xml
file extension
- load
阅读全文
0 0
- apache-comnons系列之commons-dbutils1.7 学习笔记
- apache-comnons系列之commons-lang3 学习笔记1
- apache-comnons系列之commons-codec1.11 学习笔记
- apache-comnons系列之commons-fileupload1.3.3 学习笔记
- apache-comnons系列之commons-compress1.14 学习笔记
- apache-comnons系列之commons-math3.6 学习笔记
- apache-comnons系列之commons-pool2.4 学习笔记
- apache-comnons系列之commons-email1.4 学习笔记
- apache-comnons系列之commons-net3.6 学习笔记
- apache-comnons系列之commons-imaging1.0 学习笔记
- apache-comnons系列之commons-cli1.4 学习笔记
- apache-comnons系列之commons-configuration2 学习笔记
- apache-comnons系列之commons-logging1.2 学习笔记
- apache-comnons系列之commons-vfs2 学习笔记
- apache-comnons系列之commons-chain1.2 学习笔记
- apache-comnons系列之commons-exec1.3 学习笔记
- apache-comnons系列之commons-digester 3.3.2 学习笔记
- apache-comnons系列之commons-io-2.5 org.apache.commons.io.IOUtils学习笔记
- poj 3280 区间dp
- 【Servlet】(1)Servlet简介、Servlet底层原理、Servlet实现方式、Servlet生命周期
- AOP
- php之PDO (PHP DATA OBJECT)
- Bluetooth MESH探究 --- (1)
- apache-comnons系列之commons-dbutils1.7 学习笔记
- eclipse 编辑窗口不见了(打开左边的java、xml文件,中间不会显示代码)
- Hessian序列化对象之BasicSerializer(五)
- Python 爬虫 工具 列表
- Python——程序入口main函数
- 30最棒的响应式css前端框架
- 图论小结
- 牛客网编程基础1-5
- 53. Maximum Subarray