Esempio n. 1
0
  /**
   * Create a bioseg index on the location table.
   *
   * @throws SQLException if there is a problem dropping the tabe or creating the view
   */
  public void createIndex() throws SQLException {
    Database db = this.osw.getDatabase();
    Connection con = db.getConnection();

    con.setAutoCommit(false);

    String indexSql =
        "CREATE INDEX location_object_bioseg ON location "
            + "USING gist (locatedonid, bioseg_create(intermine_start, intermine_end))";

    Statement statement = con.createStatement();
    statement.executeUpdate(indexSql);
    statement.close();

    con.commit();
    con.close();
  }
Esempio n. 2
0
 @Override
 public void setUp() throws Exception {
   db = DatabaseFactory.getDatabase("db.unittest");
   con = db.getConnection();
   con.setAutoCommit(true);
 }