static Connection conn;\r
\r
private synchronized static Connection getDBConnection() throws SQLException {\r
+ return getDBConnection(statDBName);\r
+ }\r
+\r
+ private synchronized static Connection getDBConnection(String dbname) throws SQLException {\r
\r
if (conn != null && !conn.isClosed()) {\r
return conn;\r
// Apparently under Tomcat webapp you cannot rely on Java\r
// auto discovery and have to register the driver explicitly\r
Class.forName(driver);\r
- conn = DriverManager.getConnection(protocol + statDBName + ";create=false");\r
+ conn = DriverManager.getConnection(protocol + dbname + ";create=false");\r
\r
conn.setAutoCommit(true);\r
} catch (ClassNotFoundException e) {\r
return conn;\r
}\r
\r
+ \r
+ public StatDB(String dbname) throws SQLException {\r
+ this.conn = getDBConnection(dbname);\r
+ }\r
+\r
public StatDB() throws SQLException {\r
this.conn = getDBConnection();\r
}\r