Index: trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/MySQLResultStorage.java
===================================================================
--- trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/MySQLResultStorage.java	(revision 93)
+++ trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/MySQLResultStorage.java	(revision 95)
@@ -24,4 +24,8 @@
 import java.util.Properties;
 
+import org.apache.commons.dbcp2.BasicDataSource;
+
+import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
+
 import de.lmu.ifi.dbs.elki.logging.Logging.Level;
 import de.ugoe.cs.util.console.Console;
@@ -39,5 +43,10 @@
      * Connection to the database
      */
-    private Connection con = null;
+    //private Connection con = null;
+    
+    /**
+     * Connection pool for the data base.
+     */
+    private MysqlDataSource connectionPool = null;
 
     /**
@@ -95,4 +104,9 @@
                              String dbPass)
     {
+        connectionPool = new MysqlDataSource();
+        connectionPool.setUser(dbUser);
+        connectionPool.setPassword(dbPass);
+        connectionPool.setUrl("jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName);
+        /*
         try {
             Properties connectionProperties = new Properties();
@@ -102,4 +116,5 @@
             connectionProperties.put("maxReconnects", "10000");
             Class.forName("com.mysql.jdbc.Driver");
+            
             con = DriverManager.getConnection("jdbc:mysql://" + dbHost + ":" + dbPort + "/" +
                 dbName, connectionProperties);
@@ -114,4 +129,5 @@
             Console.printerr("VendorError: " + e.getErrorCode());
         }
+        */
     }
 
@@ -153,5 +169,5 @@
         Statement stmt;
         try {
-            stmt = con.createStatement();
+            stmt = connectionPool.getConnection().createStatement();
             stmt.executeUpdate(sql.toString().replace("NaN", "NULL"));
         }
@@ -177,5 +193,5 @@
         boolean contained = false;
         try {
-            stmt = con.createStatement();
+            stmt = connectionPool.getConnection().createStatement();
             ResultSet results = stmt.executeQuery(sql);
             results.next();
@@ -188,4 +204,6 @@
             Console.printerr("SQLState: " + e.getSQLState() + "\n");
             Console.printerr("VendorError: " + e.getErrorCode() + "\n");
+            Console.printerr("\nskipping product since we could not check if the results is available");
+            contained = true;
         }
         return contained;
