package edu.umass.cs.ciir.waltz.dbindex;

import java.io.File;

/**
 * @author jfoley
 */
public class DBConfig {
  private final String jdbcURL;
  private final String password;
  private final String user;

  public DBConfig(String jdbcURL, String user, String pass) {
    this.jdbcURL = jdbcURL;
    this.user = user;
    this.password = pass;
  }
  public DBConfig(String jdbcURL) {
    this(jdbcURL, "user", "");
  }
  public String getJDBCURL() { return jdbcURL; }
  public String getUser() { return user; }
  public String getPassword() { return password; }

  public static DBConfig h2File(File file) {
    assert(!file.getName().endsWith(".mv.db"));
    return new DBConfig("jdbc:h2:file:"+file.getAbsolutePath()+";DB_CLOSE_DELAY=-1");
  }
}

@@ -46,20 +46,152 @@
 ort 
-java.io.File
+com.j256.ormlite.jdbc.JdbcConnectionSource;%0Aimport com.j256.ormlite.support.ConnectionSource;%0A%0Aimport java.io.File;%0Aimport java.sql.SQLException
 ;%0A%0A/
@@ -873,11 +873,163 @@
 1%22);%0A  %7D
+%0A%0A  public ConnectionSource getConnectionSource() throws SQLException %7B%0A    return new JdbcConnectionSource(getJDBCURL(), getUser(), getPassword());%0A  %7D
 %0A%7D%0A

Add connection source function for using this for other purposes