Exemplo n.º 1
0
  /** make SQL query for certain operation and return the result. */
  public Map executeSQLOperation(String operation, boolean reflectCustomFilter)
      throws KExceptionClass {

    dbTransactionClientClass dbTransaction = new dbTransactionClientClass(configuration, log);
    String sql;

    if (reflectCustomFilter) {
      // do bind custom parameters
      sql = " SELECT " + operation + " FROM " + tableName + finalWhere;
      bindDBtransaction(dbTransaction, sql);

    } else {
      // do NOT bind custom parameters
      sql = " SELECT " + operation + " FROM " + tableName + defaultWhere;
      bindDefaultDBtransaction(dbTransaction, sql);
    }
    ;

    // Query to DB
    dbTransaction.executeQuery(0, 10);

    if (!dbTransaction.fetch())
      throw new KExceptionClass(
          "*** SQL total error **** \n" + "No row was returned." + "SQL: [" + sql + "]\n ", null);

    return (dbTransaction);
  }
Exemplo n.º 2
0
 /** check whether therer is any loaded value */
 public boolean nextRowValue() throws KExceptionClass {
   return dbTransactionClient.fetch();
 }