diff --git a/commons-dbutils-tutorial/README.md b/commons-dbutils-tutorial/README.md
new file mode 100644
index 0000000..9b955ba
--- /dev/null
+++ b/commons-dbutils-tutorial/README.md
@@ -0,0 +1,18 @@
+# commons-dbutils-tutorial
+
+* BeanHandler
+
+* BeanListHandler
+
+* MapListHandler
+
+* ResultSetHandler
+
+* ArrayListHandler
+
+* DataSource
+
+
+[http://www.javatips.net/blog/2014/03/apache-dbutils-tutorial](http://www.javatips.net/blog/2014/03/apache-dbutils-tutorial)
+
+[http://www.codesuggestions.com/java/apache-commons-dbutils-tutorial/](http://www.codesuggestions.com/java/apache-commons-dbutils-tutorial/)
diff --git a/commons-dbutils-tutorial/pom.xml b/commons-dbutils-tutorial/pom.xml
new file mode 100644
index 0000000..3388237
--- /dev/null
+++ b/commons-dbutils-tutorial/pom.xml
@@ -0,0 +1,68 @@
+
+
+ 4.0.0
+
+ net.aimeizi
+ maven-framework-project
+ 1.0.0
+
+ commons-dbutils-tutorial
+ commons-dbutils-tutorial
+ http://maven.apache.org
+
+ UTF-8
+
+
+
+
+ commons-dbutils
+ commons-dbutils
+ 1.5
+
+
+
+ com.h2database
+ h2
+ 1.4.179
+
+
+
+ commons-dbcp
+ commons-dbcp
+ 1.4
+
+
+
+ commons-pool
+ commons-pool
+ 1.6
+
+
+
+ c3p0
+ c3p0
+ 0.9.1.1
+
+
+
+ com.mchange
+ mchange-commons-java
+ 0.2.7
+
+
+
+ com.jolbox
+ bonecp
+ 0.8.0.RELEASE
+
+
+
+ mysql
+ mysql-connector-java
+ 5.1.31
+
+
+
+
diff --git a/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/datasource/tutorial/BoneCPDataSource.java b/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/datasource/tutorial/BoneCPDataSource.java
new file mode 100644
index 0000000..80009c2
--- /dev/null
+++ b/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/datasource/tutorial/BoneCPDataSource.java
@@ -0,0 +1,74 @@
+package org.commons.dbutils.datasource.tutorial;
+
+import java.beans.PropertyVetoException;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+import com.jolbox.bonecp.BoneCP;
+import com.jolbox.bonecp.BoneCPConfig;
+
+public class BoneCPDataSource {
+
+ private DataSource dataSource;
+
+ private static BoneCPDataSource boneCPDataSource;
+
+ private BoneCP connectionPool;
+
+ private BoneCPDataSource() throws IOException, SQLException,
+ PropertyVetoException {
+ try {
+ // load the database driver (make sure this is in your classpath!)
+ Class.forName("org.h2.Driver");
+ } catch (Exception e) {
+ e.printStackTrace();
+ return;
+ }
+
+ try {
+ // setup the connection pool using BoneCP Configuration
+ BoneCPConfig config = new BoneCPConfig();
+ // jdbc url specific to your database, eg
+ // jdbc:mysql://127.0.0.1/yourdb
+ config.setJdbcUrl("jdbc:h2:./target/test;AUTO_SERVER=TRUE");
+ config.setUsername("sa");
+ config.setPassword("");
+ config.setMinConnectionsPerPartition(5);
+ config.setMaxConnectionsPerPartition(10);
+ config.setPartitionCount(1);
+ // setup the connection pool
+ connectionPool = new BoneCP(config);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ return;
+ }
+
+ }
+
+ public static BoneCPDataSource getInstance() throws IOException,
+ SQLException, PropertyVetoException {
+ if (boneCPDataSource == null) {
+ boneCPDataSource = new BoneCPDataSource();
+ return boneCPDataSource;
+ } else {
+ return boneCPDataSource;
+ }
+ }
+
+ public Connection getConnection() throws SQLException {
+ return this.connectionPool.getConnection();
+ }
+
+ public DataSource getDataSource() {
+ return dataSource;
+ }
+
+ public void setDataSource(DataSource dataSource) {
+ this.dataSource = dataSource;
+ }
+
+}
diff --git a/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/datasource/tutorial/C3P0DataSource.java b/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/datasource/tutorial/C3P0DataSource.java
new file mode 100644
index 0000000..ce64c9a
--- /dev/null
+++ b/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/datasource/tutorial/C3P0DataSource.java
@@ -0,0 +1,60 @@
+package org.commons.dbutils.datasource.tutorial;
+
+import java.beans.PropertyVetoException;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+import com.mchange.v2.c3p0.ComboPooledDataSource;
+
+public class C3P0DataSource {
+
+ private DataSource dataSource;
+
+ private static C3P0DataSource c3p0DataSource;
+
+ private ComboPooledDataSource cpds;
+
+ private C3P0DataSource() throws IOException, SQLException,
+ PropertyVetoException {
+ cpds = new ComboPooledDataSource();
+ cpds.setDriverClass("org.h2.Driver"); // loads the jdbc driver
+ cpds.setJdbcUrl("jdbc:h2:./target/test;AUTO_SERVER=TRUE");
+ cpds.setUser("sa");
+ cpds.setPassword("");
+
+ // the settings below are optional -- c3p0 can work with defaults
+ cpds.setMinPoolSize(5);
+ cpds.setAcquireIncrement(5);
+ cpds.setMaxPoolSize(20);
+ cpds.setMaxStatements(180);
+
+ this.setDataSource(cpds);
+
+ }
+
+ public static C3P0DataSource getInstance() throws IOException,
+ SQLException, PropertyVetoException {
+ if (c3p0DataSource == null) {
+ c3p0DataSource = new C3P0DataSource();
+ return c3p0DataSource;
+ } else {
+ return c3p0DataSource;
+ }
+ }
+
+ public Connection getConnection() throws SQLException {
+ return this.cpds.getConnection();
+ }
+
+ public DataSource getDataSource() {
+ return dataSource;
+ }
+
+ public void setDataSource(DataSource dataSource) {
+ this.dataSource = dataSource;
+ }
+
+}
diff --git a/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/datasource/tutorial/DBCPDataSource.java b/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/datasource/tutorial/DBCPDataSource.java
new file mode 100644
index 0000000..4a0acd8
--- /dev/null
+++ b/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/datasource/tutorial/DBCPDataSource.java
@@ -0,0 +1,60 @@
+package org.commons.dbutils.datasource.tutorial;
+
+import java.beans.PropertyVetoException;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+import org.apache.commons.dbcp.BasicDataSource;
+
+public class DBCPDataSource {
+
+ private DataSource dataSource;
+
+ private static DBCPDataSource dbcpDataSource;
+
+ private BasicDataSource ds;
+
+ private DBCPDataSource() throws IOException, SQLException,
+ PropertyVetoException {
+
+ ds = new BasicDataSource();
+ ds.setDriverClassName("org.h2.Driver");
+ ds.setUsername("sa");
+ ds.setPassword("");
+ ds.setUrl("jdbc:h2:./target/test;AUTO_SERVER=TRUE");
+
+ // the settings below are optional -- dbcp can work with defaults
+ ds.setMinIdle(5);
+ ds.setMaxIdle(20);
+ ds.setMaxOpenPreparedStatements(180);
+
+ this.setDataSource(ds);
+
+ }
+
+ public static DBCPDataSource getInstance() throws IOException,
+ SQLException, PropertyVetoException {
+ if (dbcpDataSource == null) {
+ dbcpDataSource = new DBCPDataSource();
+ return dbcpDataSource;
+ } else {
+ return dbcpDataSource;
+ }
+ }
+
+ public DataSource getDataSource() {
+ return this.dataSource;
+ }
+
+ public void setDataSource(DataSource dataSource) {
+ this.dataSource = dataSource;
+ }
+
+ public Connection getConnection() throws SQLException {
+ return this.ds.getConnection();
+ }
+
+}
diff --git a/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/employee/tutorial/ArrayListHandlerExample.java b/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/employee/tutorial/ArrayListHandlerExample.java
new file mode 100644
index 0000000..484e9ef
--- /dev/null
+++ b/commons-dbutils-tutorial/src/main/java/org/commons/dbutils/employee/tutorial/ArrayListHandlerExample.java
@@ -0,0 +1,38 @@
+package org.commons.dbutils.employee.tutorial;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.List;
+import org.apache.commons.dbutils.DbUtils;
+import org.apache.commons.dbutils.QueryRunner;
+import org.apache.commons.dbutils.handlers.ArrayListHandler;
+
+public class ArrayListHandlerExample {
+
+ public static void main(String[] args) throws SQLException {
+
+ final String url = "jdbc:h2:./target/test;AUTO_SERVER=TRUE";
+ final String driver = "org.h2.Driver";
+ final String usr = "sa";
+ final String pwd = "";
+
+ QueryRunner run = new QueryRunner();
+
+ DbUtils.loadDriver(driver);
+ Connection conn = DriverManager.getConnection(url, usr, pwd);
+ // -----------------------------------------------------------------------------------
+
+ try {
+ List