Package co.nubetech.hiho.common

Examples of co.nubetech.hiho.common.HIHOException


    }
  }

  public void checkMandatoryConfs(Configuration conf) throws HIHOException {
    if (inputPath == null) {
      throw new HIHOException(
          "The provided inputPath is empty, please specify inputPath");
    }
    if (conf.get(HIHOConf.ORACLE_FTP_USER) == null) {
      throw new HIHOException(
          "The Oracle FTP UserName is not specified, please specify Oracle FTP UserName");
    }
    if (conf.get(HIHOConf.ORACLE_FTP_ADDRESS) == null) {
      throw new HIHOException(
          "The Oracle FTP Address is not specified, please specify Oracle FTP Address");
    }
    if (conf.get(HIHOConf.ORACLE_FTP_PORT) == null) {
      throw new HIHOException(
          "The Oracle FTP Port Number is not defined, please specify Oracle FTP Port Number");
    }
    if (conf.get(HIHOConf.ORACLE_FTP_PASSWORD) == null) {
      throw new HIHOException(
          "The Oracle FTP Password is not defined, please specify Oracle FTP Password");
    }
    if (conf.get(HIHOConf.ORACLE_EXTERNAL_TABLE_DIR) == null) {
      throw new HIHOException(
          "The Oracle External Table Directory is not specified, please specify Oracle External Table Directory");
    }
    if (conf.get(DBConfiguration.DRIVER_CLASS_PROPERTY) == null) {
      throw new HIHOException(
          "The JDBC Driver is not specified, please specify JDBC Driver");
    }
    if (conf.get(DBConfiguration.URL_PROPERTY) == null) {
      throw new HIHOException(
          "The JDBC URL is not specified, please specify JDBC URL");
    }
    if (conf.get(DBConfiguration.USERNAME_PROPERTY) == null) {
      throw new HIHOException(
          "The JDBC USERNAME is not specified, please specify JDBC USERNAME");
    }
    if (conf.get(DBConfiguration.PASSWORD_PROPERTY) == null) {
      throw new HIHOException(
          "The JDBC PASSWORD is not specified, please specify JDBC PASSWORD");
    }
    if (conf.get(HIHOConf.EXTERNAL_TABLE_DML) == null) {
      throw new HIHOException(
          "The query to create external table is not specified, please specify the create query for external table");
    }
   
  }
View Full Code Here


  }

  public static String getTableName(String query) throws HIHOException {
    String tableName = null;
    if (query == null)
      throw new HIHOException("Cannot read query");

    try {
      StringTokenizer tokenizer = new StringTokenizer(query, "() ");
      while (tokenizer.hasMoreTokens()) {
        String token = tokenizer.nextToken();
        if (token.equalsIgnoreCase("table")) {
          tableName = tokenizer.nextToken();
        }
      }
    } catch (Exception e) {
      throw new HIHOException(
          "Unable to get table name from the external table query");
    }
    if (tableName == null) {
      throw new HIHOException(
          "Unable to get table name from the external table query");
    }
    return tableName;
  }
View Full Code Here

  }

  public static String getExternalDir(String query) throws HIHOException {
    String tableName = null;
    if (query == null)
      throw new HIHOException("Cannot read query");

    try {
      StringTokenizer tokenizer = new StringTokenizer(query, " ");
      while (tokenizer.hasMoreTokens()) {
        String token = tokenizer.nextToken();
        if (token.equalsIgnoreCase("directory")) {
          tableName = tokenizer.nextToken();
        }
      }
    } catch (Exception e) {
      throw new HIHOException(
          "Unable to get directory name from the external table query");
    }
    if (tableName == null) {
      throw new HIHOException(
          "Unable to get directory name from the external table query");
    }
    return tableName;
  }
View Full Code Here

      stmt.close();
      conn.close();

    } catch (Exception e) {
      e.printStackTrace();
      throw new HIHOException("Sql syntax error in query " + query + e);
    }

  }
View Full Code Here

TOP

Related Classes of co.nubetech.hiho.common.HIHOException

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.