From e76038cd0f9a7aa7a1082fa2c03098334f4eb14b Mon Sep 17 00:00:00 2001 From: zyyang Date: Wed, 27 Jan 2021 14:02:18 +0800 Subject: [PATCH] change --- tests/examples/JDBC/JDBCDemo/pom.xml | 2 +- .../JDBC/connectionPools/README-cn.md | 4 +-- tests/examples/JDBC/connectionPools/pom.xml | 33 +++++++++++++++++-- .../{demo => example}/ConnectionPoolDemo.java | 14 +++----- .../{demo => example}/common/InsertTask.java | 2 +- .../{demo => example}/pool/C3p0Builder.java | 3 +- .../{demo => example}/pool/DbcpBuilder.java | 2 +- .../pool/DruidPoolBuilder.java | 2 +- .../pool/HikariCpBuilder.java | 2 +- 9 files changed, 44 insertions(+), 20 deletions(-) rename tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/{demo => example}/ConnectionPoolDemo.java (91%) rename tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/{demo => example}/common/InsertTask.java (97%) rename tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/{demo => example}/pool/C3p0Builder.java (89%) rename tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/{demo => example}/pool/DbcpBuilder.java (93%) rename tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/{demo => example}/pool/DruidPoolBuilder.java (95%) rename tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/{demo => example}/pool/HikariCpBuilder.java (97%) diff --git a/tests/examples/JDBC/JDBCDemo/pom.xml b/tests/examples/JDBC/JDBCDemo/pom.xml index d075fc8f2a..6f0c58a821 100644 --- a/tests/examples/JDBC/JDBCDemo/pom.xml +++ b/tests/examples/JDBC/JDBCDemo/pom.xml @@ -52,7 +52,7 @@ com.taosdata.jdbc taos-jdbcdriver - 2.0.15 + 2.0.18 diff --git a/tests/examples/JDBC/connectionPools/README-cn.md b/tests/examples/JDBC/connectionPools/README-cn.md index 761596dfc5..139a94e36d 100644 --- a/tests/examples/JDBC/connectionPools/README-cn.md +++ b/tests/examples/JDBC/connectionPools/README-cn.md @@ -12,12 +12,12 @@ ConnectionPoolDemo的程序逻辑: ### 如何运行这个例子: ```shell script -# mvn exec:java -Dexec.mainClass="com.taosdata.demo.ConnectionPoolDemo" -Dexec.args="-host localhost" +# mvn exec:java -Dexec.mainClass="com.taosdata.example.ConnectionPoolDemo" -Dexec.args="-host localhost" ``` 使用mvn运行ConnectionPoolDemo的main方法,可以指定参数 ```shell script Usage: -mvn exec:java -Dexec.mainClass="com.taosdata.demo.ConnectionPoolDemo" -Dexec.args="" +mvn exec:java -Dexec.mainClass="com.taosdata.example.ConnectionPoolDemo" -Dexec.args="" -host : hostname -poolType -poolSize diff --git a/tests/examples/JDBC/connectionPools/pom.xml b/tests/examples/JDBC/connectionPools/pom.xml index fbee256067..84467003f9 100644 --- a/tests/examples/JDBC/connectionPools/pom.xml +++ b/tests/examples/JDBC/connectionPools/pom.xml @@ -12,7 +12,7 @@ com.taosdata.jdbc taos-jdbcdriver - 2.0.17 + 2.0.18 @@ -50,6 +50,35 @@ log4j 1.2.17 - + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.1.0 + + + + com.taosdata.example.ConnectionPoolDemo + + + + jar-with-dependencies + + + + + make-assembly + package + + single + + + + + + + \ No newline at end of file diff --git a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/ConnectionPoolDemo.java b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/ConnectionPoolDemo.java similarity index 91% rename from tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/ConnectionPoolDemo.java rename to tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/ConnectionPoolDemo.java index 6787e07423..7b603ec97f 100644 --- a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/ConnectionPoolDemo.java +++ b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/ConnectionPoolDemo.java @@ -1,19 +1,15 @@ -package com.taosdata.demo; +package com.taosdata.example; -import com.taosdata.demo.common.InsertTask; -import com.taosdata.demo.pool.C3p0Builder; -import com.taosdata.demo.pool.DbcpBuilder; -import com.taosdata.demo.pool.DruidPoolBuilder; -import com.taosdata.demo.pool.HikariCpBuilder; +import com.taosdata.example.pool.C3p0Builder; +import com.taosdata.example.pool.DbcpBuilder; +import com.taosdata.example.pool.DruidPoolBuilder; +import com.taosdata.example.pool.HikariCpBuilder; import org.apache.log4j.Logger; import javax.sql.DataSource; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; public class ConnectionPoolDemo { diff --git a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/common/InsertTask.java b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/common/InsertTask.java similarity index 97% rename from tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/common/InsertTask.java rename to tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/common/InsertTask.java index 2396287fec..e39a613aa6 100644 --- a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/common/InsertTask.java +++ b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/common/InsertTask.java @@ -1,4 +1,4 @@ -package com.taosdata.demo.common; +package com.taosdata.example.common; import org.apache.log4j.Logger; diff --git a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/C3p0Builder.java b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/C3p0Builder.java similarity index 89% rename from tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/C3p0Builder.java rename to tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/C3p0Builder.java index 587f417410..235db0bb79 100644 --- a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/C3p0Builder.java +++ b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/C3p0Builder.java @@ -1,7 +1,6 @@ -package com.taosdata.demo.pool; +package com.taosdata.example.pool; import com.mchange.v2.c3p0.ComboPooledDataSource; -import org.apache.commons.dbcp.BasicDataSource; import javax.sql.DataSource; import java.beans.PropertyVetoException; diff --git a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/DbcpBuilder.java b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/DbcpBuilder.java similarity index 93% rename from tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/DbcpBuilder.java rename to tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/DbcpBuilder.java index 3c34a32532..3aa9e4ebcf 100644 --- a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/DbcpBuilder.java +++ b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/DbcpBuilder.java @@ -1,4 +1,4 @@ -package com.taosdata.demo.pool; +package com.taosdata.example.pool; import org.apache.commons.dbcp.BasicDataSource; diff --git a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/DruidPoolBuilder.java b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/DruidPoolBuilder.java similarity index 95% rename from tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/DruidPoolBuilder.java rename to tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/DruidPoolBuilder.java index e9fc496af3..500f0e9e97 100644 --- a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/DruidPoolBuilder.java +++ b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/DruidPoolBuilder.java @@ -1,4 +1,4 @@ -package com.taosdata.demo.pool; +package com.taosdata.example.pool; import com.alibaba.druid.pool.DruidDataSource; diff --git a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/HikariCpBuilder.java b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/HikariCpBuilder.java similarity index 97% rename from tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/HikariCpBuilder.java rename to tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/HikariCpBuilder.java index 5cfe7e6e6a..7e151de3e0 100644 --- a/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/demo/pool/HikariCpBuilder.java +++ b/tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/HikariCpBuilder.java @@ -1,4 +1,4 @@ -package com.taosdata.demo.pool; +package com.taosdata.example.pool; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; -- GitLab