Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
e76038cd
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e76038cd
编写于
1月 27, 2021
作者:
Z
zyyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change
上级
9ed2f88b
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
44 addition
and
20 deletion
+44
-20
tests/examples/JDBC/JDBCDemo/pom.xml
tests/examples/JDBC/JDBCDemo/pom.xml
+1
-1
tests/examples/JDBC/connectionPools/README-cn.md
tests/examples/JDBC/connectionPools/README-cn.md
+2
-2
tests/examples/JDBC/connectionPools/pom.xml
tests/examples/JDBC/connectionPools/pom.xml
+31
-2
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/ConnectionPoolDemo.java
...rc/main/java/com/taosdata/example/ConnectionPoolDemo.java
+5
-9
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/common/InsertTask.java
...src/main/java/com/taosdata/example/common/InsertTask.java
+1
-1
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/C3p0Builder.java
.../src/main/java/com/taosdata/example/pool/C3p0Builder.java
+1
-2
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/DbcpBuilder.java
.../src/main/java/com/taosdata/example/pool/DbcpBuilder.java
+1
-1
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/DruidPoolBuilder.java
...main/java/com/taosdata/example/pool/DruidPoolBuilder.java
+1
-1
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/example/pool/HikariCpBuilder.java
.../main/java/com/taosdata/example/pool/HikariCpBuilder.java
+1
-1
未找到文件。
tests/examples/JDBC/JDBCDemo/pom.xml
浏览文件 @
e76038cd
...
...
@@ -52,7 +52,7 @@
<dependency>
<groupId>
com.taosdata.jdbc
</groupId>
<artifactId>
taos-jdbcdriver
</artifactId>
<version>
2.0.1
5
</version>
<version>
2.0.1
8
</version>
</dependency>
</dependencies>
...
...
tests/examples/JDBC/connectionPools/README-cn.md
浏览文件 @
e76038cd
...
...
@@ -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="<args>"
mvn exec:java -Dexec.mainClass="com.taosdata.
example
.ConnectionPoolDemo" -Dexec.args="<args>"
-host : hostname
-poolType <c3p0| dbcp| druid| hikari>
-poolSize <poolSize>
...
...
tests/examples/JDBC/connectionPools/pom.xml
浏览文件 @
e76038cd
...
...
@@ -12,7 +12,7 @@
<dependency>
<groupId>
com.taosdata.jdbc
</groupId>
<artifactId>
taos-jdbcdriver
</artifactId>
<version>
2.0.1
7
</version>
<version>
2.0.1
8
</version>
</dependency>
<!-- druid -->
...
...
@@ -50,6 +50,35 @@
<artifactId>
log4j
</artifactId>
<version>
1.2.17
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
3.1.0
</version>
<configuration>
<archive>
<manifest>
<mainClass>
com.taosdata.example.ConnectionPoolDemo
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
demo
/ConnectionPoolDemo.java
→
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
example
/ConnectionPoolDemo.java
浏览文件 @
e76038cd
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
{
...
...
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
demo
/common/InsertTask.java
→
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
example
/common/InsertTask.java
浏览文件 @
e76038cd
package
com.taosdata.
demo
.common
;
package
com.taosdata.
example
.common
;
import
org.apache.log4j.Logger
;
...
...
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
demo
/pool/C3p0Builder.java
→
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
example
/pool/C3p0Builder.java
浏览文件 @
e76038cd
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
;
...
...
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
demo
/pool/DbcpBuilder.java
→
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
example
/pool/DbcpBuilder.java
浏览文件 @
e76038cd
package
com.taosdata.
demo
.pool
;
package
com.taosdata.
example
.pool
;
import
org.apache.commons.dbcp.BasicDataSource
;
...
...
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
demo
/pool/DruidPoolBuilder.java
→
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
example
/pool/DruidPoolBuilder.java
浏览文件 @
e76038cd
package
com.taosdata.
demo
.pool
;
package
com.taosdata.
example
.pool
;
import
com.alibaba.druid.pool.DruidDataSource
;
...
...
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
demo
/pool/HikariCpBuilder.java
→
tests/examples/JDBC/connectionPools/src/main/java/com/taosdata/
example
/pool/HikariCpBuilder.java
浏览文件 @
e76038cd
package
com.taosdata.
demo
.pool
;
package
com.taosdata.
example
.pool
;
import
com.zaxxer.hikari.HikariConfig
;
import
com.zaxxer.hikari.HikariDataSource
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录