Skip to content

Commit fdc58c4

Browse files
committed
Signed-off-by: chenhaoxiang <chxpostbox@outlook.com>
1 parent aa02af9 commit fdc58c4

37 files changed

Lines changed: 571 additions & 0 deletions

‎myDbPoolUse/.classpath‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_04"/>
5+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
6+
<classpathentry kind="lib" path="src/cn/hncu/bin/commons-dbcp2-2.1.1.jar"/>
7+
<classpathentry kind="lib" path="src/cn/hncu/bin/commons-logging-1.2.jar"/>
8+
<classpathentry kind="lib" path="src/cn/hncu/bin/commons-pool2-2.4.2.jar"/>
9+
<classpathentry kind="lib" path="src/cn/hncu/bin/mysql-connector-java-5.1.39-bin.jar"/>
10+
<classpathentry kind="lib" path="src/cn/hncu/bin/c3p0-0.9.1.2.jar"/>
11+
<classpathentry kind="lib" path="src/cn/hncu/bin/c3p0-sources-0.9.1.2.jar"/>
12+
<classpathentry kind="lib" path="src/cn/hncu/bin/commons-dbutils-1.6.jar"/>
13+
<classpathentry kind="lib" path="src/cn/hncu/bin/commons-dbutils-ext.jar"/>
14+
<classpathentry kind="output" path="bin"/>
15+
</classpath>

‎myDbPoolUse/.project‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>myDbPoolUse</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Mon Aug 15 15:13:10 CST 2016
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.6
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.source=1.6

‎myDbPoolUse/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BasicDataSource创建DataSource(DBCP连接池配置)
2+
ComboPooledDataSource(C3P0连接池配置)
3+
Apache的DBUtils框架使用

‎myDbPoolUse/bin/c3p0-config.xml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<c3p0-config>
2+
<!-- 默认配置,如果没有指定则使用这个配置 -->
3+
<default-config>
4+
<property name="driverClass">com.mysql.jdbc.Driver</property>
5+
<property name="jdbcUrl">
6+
<![CDATA[jdbc:mysql://127.0.0.1:3306/hncu?useUnicode=true&characterEncoding=UTF-8]]>
7+
</property>
8+
<property name="user">root</property>
9+
<property name="password">1234</property>
10+
<!-- 初始化池大小 -->
11+
<property name="initialPoolSize">2</property>
12+
<!-- 最大空闲时间 -->
13+
<property name="maxIdleTime">30</property>
14+
<!-- 最多有多少个连接 -->
15+
<property name="maxPoolSize">10</property>
16+
<!-- 最少几个连接 -->
17+
<property name="minPoolSize">2</property>
18+
<!-- 每次最多可以执行多少个批处理语句 -->
19+
<property name="maxStatements">50</property>
20+
</default-config>
21+
<!-- 命名的配置 -->
22+
<named-config name="demo">
23+
<property name="driverClass">com.mysql.jdbc.Driver</property>
24+
<property name="jdbcUrl"><![CDATA[jdbc:mysql://127.0.0.1:3306/hncu?useUnicode=true&characterEncoding=UTF-8]]></property>
25+
<property name="user">root</property>
26+
<property name="password">1234</property>
27+
<property name="acquireIncrement">5</property><!-- 如果池中数据连接不够时一次增长多少个 -->
28+
<property name="initialPoolSize">100</property>
29+
<property name="minPoolSize">50</property>
30+
<property name="maxPoolSize">1000</property>
31+
<property name="maxStatements">0</property>
32+
<property name="maxStatementsPerConnection">5</property> <!-- he's important, but there's only one of him -->
33+
</named-config>
34+
</c3p0-config>
1.81 KB
Binary file not shown.
1.12 KB
Binary file not shown.
603 KB
Binary file not shown.
450 KB
Binary file not shown.
170 KB
Binary file not shown.

0 commit comments

Comments
 (0)