Skip to content
Snippets Groups Projects
Commit 566df6b1 authored by Karl Mortensen's avatar Karl Mortensen
Browse files

Connection Pooling

parent e53b79f7
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<dependency org="org.postgresql" name="postgresql" rev="9.4-1201-jdbc41" > <dependency org="org.postgresql" name="postgresql" rev="9.4-1201-jdbc41" >
<artifact name="postgresql" type="jar" /> <artifact name="postgresql" type="jar" />
</dependency> </dependency>
<dependency org="com.mchange" name="c3p0" rev="0.9.5" />
</dependencies> </dependencies>
</ivy-module> </ivy-module>
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3"> <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3">
<compilation-unit> <compilation-unit>
<package-root>src</package-root> <package-root>src</package-root>
<classpath mode="compile">lib;lib/diffutils-1.2.1.jar;lib/junit-4.8.2.jar;lib/sqlite-jdbc-3.7.15-M1.jar;lib/postgresql-9.4-1201.jdbc41.jar</classpath> <classpath mode="compile">lib;lib/diffutils-1.2.1.jar;lib/junit-4.8.2.jar;lib/sqlite-jdbc-3.7.15-M1.jar;lib/postgresql-9.4-1201.jdbc41.jar;lib/c3p0-0.9.5.jar;lib/mchange-commons-java-0.2.9.jar;lib/c3p0-0.9.5-sources.jar;lib/c3p0-0.9.5-javadoc.jar</classpath>
<built-to>build</built-to> <built-to>build</built-to>
<source-level>1.6</source-level> <source-level>1.6</source-level>
</compilation-unit> </compilation-unit>
......
...@@ -102,12 +102,14 @@ public boolean settingsValid() { ...@@ -102,12 +102,14 @@ public boolean settingsValid() {
try { try {
switch (dbType) { switch (dbType) {
case POSTGRESQL: case POSTGRESQL:
/// TODO this should be done through the connection pool if we can.
Connection conn = DriverManager.getConnection( Connection conn = DriverManager.getConnection(
"jdbc:postgresql://" + this.hostNameOrIP + ":" + this.portNumber + "/postgres", "jdbc:postgresql://" + this.hostNameOrIP + ":" + this.portNumber + "/postgres",
this.userName, this.userName,
this.password); // NON-NLS this.password); // NON-NLS
if (conn != null) { if (conn != null) {
commsEstablished = true; commsEstablished = true;
conn.close();
} }
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment