Package org.platformlayer.ops.postgres

Examples of org.platformlayer.ops.postgres.DatabaseConnection


  public void handler() {
  }

  @Override
  protected void addChildren() throws OpsException {
    DatabaseConnection dbConnection;
    {
      dbConnection = addChild(DatabaseConnection.build(model.server));

      dbConnection.databaseName = model.databaseName;
      // We need to run as superuser
      // dbConnection.username = template.getAuthDatabaseUsername();
      // dbConnection.password = template.getAuthDatabasePassword();
    }

    {
      CreateDatabase db = dbConnection.addChild(CreateDatabase.class);
      db.databaseName = model.databaseName;
    }

    {
      CreateUser db = dbConnection.addChild(CreateUser.class);
      db.grantDatabaseName = model.databaseName;
      db.databaseUser = model.username;
      db.databasePassword = model.password;
    }

    {
      RunScript script = dbConnection.addChild(RunScript.class);
      try {
        script.sql = ResourceUtils.get(getClass(), "schema.sql");
      } catch (IOException e) {
        throw new OpsException("Error loading SQL script resource", e);
      }
View Full Code Here


  @Override
  protected void addChildren() throws OpsException {
    GerritDatabaseTemplate template = injected(GerritDatabaseTemplate.class);

    DatabaseConnection dbConnection;
    {
      dbConnection = addChild(DatabaseConnection.build(template.getDatabaseServerKey()));

      dbConnection.databaseName = template.getDatabaseName();
    }

    {
      CreateDatabase db = dbConnection.addChild(CreateDatabase.class);
      db.databaseName = template.getDatabaseName();
    }

    {
      CreateUser db = dbConnection.addChild(CreateUser.class);
      db.grantDatabaseName = template.getDatabaseName();
      db.databaseUser = template.getDatabaseUsername();
      db.databasePassword = template.getDatabasePassword();
    }

    {
      RunScript script = dbConnection.addChild(RunScript.class);
      try {
        script.sql = ResourceUtils.get(getClass(), "schema.sql");
      } catch (IOException e) {
        throw new OpsException("Error loading SQL script resource", e);
      }
View Full Code Here

  public void handler() {
  }

  @Override
  protected void addChildren() throws OpsException {
    DatabaseConnection dbConnection;
    {
      dbConnection = addChild(DatabaseConnection.build(model.server));

      dbConnection.databaseName = model.databaseName;
      // We need to run as superuser
      // dbConnection.username = template.getAuthDatabaseUsername();
      // dbConnection.password = template.getAuthDatabasePassword();
    }

    {
      CreateDatabase db = dbConnection.addChild(CreateDatabase.class);
      db.databaseName = model.databaseName;
    }

    {
      CreateUser db = dbConnection.addChild(CreateUser.class);
      db.grantDatabaseName = model.databaseName;
      db.databaseUser = model.username;
      db.databasePassword = model.password;
    }

    {
      RunScript script = dbConnection.addChild(RunScript.class);
      try {
        script.sql = ResourceUtils.get(getClass(), "auth_schema.sql");
      } catch (IOException e) {
        throw new OpsException("Error loading SQL script resource", e);
      }
View Full Code Here

  public void handler() throws OpsException {
  }

  @Override
  protected void addChildren() throws OpsException {
    DatabaseConnection dbConnection;
    {
      dbConnection = addChild(DatabaseConnection.build(model.server));

      dbConnection.databaseName = model.databaseName;
    }

    {
      CreateDatabase db = dbConnection.addChild(CreateDatabase.class);
      db.databaseName = model.databaseName;
    }

    {
      CreateUser db = dbConnection.addChild(CreateUser.class);
      db.grantDatabaseName = model.databaseName;
      db.databaseUser = model.username;
      db.databasePassword = model.password;
    }
  }
View Full Code Here

TOP

Related Classes of org.platformlayer.ops.postgres.DatabaseConnection

Copyright © 2018 www.massapicom. 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.