Exemple #1
0
  @Override
  protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException {
    /* Retrieve connection information from the environment variables, if not already set */
    if (connectionInfo == null && execEnvVars != null) {
      connectionInfo =
          (ConnectionInfo) execEnvVars.get(MyriaConstants.EXEC_ENV_VAR_DATABASE_CONN_INFO);
    }
    /* Open the database connection */
    accessMethod = AccessMethod.of(connectionInfo.getDbms(), connectionInfo, false);

    /* Drop the table */
    accessMethod.dropTableIfExistsCascade(relationKey);
  }
Exemple #2
0
 @Override
 public void cleanup() {
   try {
     if (accessMethod != null) {
       accessMethod.close();
     }
   } catch (DbException e) {
     throw new RuntimeException(e);
   }
 }