Examples of DbManagement


Examples of com.opengamma.util.db.management.DbManagement

    BoneCPDataSource dataSource = (BoneCPDataSource) getDbConnector().getDataSource();
    String jdbcUrl = dataSource.getJdbcUrl();
    if (jdbcUrl == null) {
      throw new OpenGammaRuntimeException("No JDBC URL specified");
    }
    DbManagement dbManagement = DbManagementUtils.getDbManagement(jdbcUrl);
    int lastSlashIdx = jdbcUrl.lastIndexOf("/");
    if (lastSlashIdx == -1) {
      throw new OpenGammaRuntimeException("JDBC URL must contain '/' before the database name");
    }

    // REVIEW jonathan 2013-05-14 -- should not be doing this (PLAT-2745)
    int lastSlash = jdbcUrl.lastIndexOf('/');
    if (lastSlash == -1 || lastSlash == jdbcUrl.length() - 1) {
      throw new OpenGammaRuntimeException("JDBC URL must contain a slash separating the server host and the database name");
    }
    String dbServerHost = jdbcUrl.substring(0, lastSlash);
    String catalog = jdbcUrl.substring(lastSlashIdx + 1);
    String user = dataSource.getUsername();
    String password = dataSource.getPassword();
    dbManagement.initialise(dbServerHost, user, password);
   
    Integer expectedSchemaVersion = DbScriptUtils.getCurrentVersion(schemaName);
    if (expectedSchemaVersion == null) {
      throw new OpenGammaRuntimeException("Unable to find schema version information for " + schemaName + ". Database objects cannot be managed.");
    }
View Full Code Here

Examples of com.opengamma.util.db.management.DbManagement

    if (lastSlashIdx == -1) {
      throw new OpenGammaRuntimeException("JDBC URL must contain '/' before the database name");
    }
    String dbHost = getJdbcUrl().substring(0, lastSlashIdx);
   
    DbManagement dbManangement = DbManagementUtils.getDbManagement(dbHost);
    dbManangement.initialise(dbHost, getUsername(), getPassword());
    ComponentInfo info = new ComponentInfo(DbManagement.class, getClassifier());
    repo.registerComponent(info, dbManangement);
    return dbManangement;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.