Examples of DataAccessException


Examples of com.quickorm.dao.DataAccessException

        EntityMetaData entityMetaData = getEntityMetaData(entityClass);
        //得到SQL语句与参数
        SqlAndArgumentsData sqlAndArgumentsData = entityMetaData.getInsertSqlAndArgumentData(t, dialect);
        int rowCount = this.executeUpdate(sqlAndArgumentsData.getSql(), sqlAndArgumentsData.getArgumentList(), null);
        if (rowCount <= 0) {
            throw new DataAccessException("更改的数据行数为0!");
        }
    }
View Full Code Here

Examples of com.skyline.energy.exception.DataAccessException

  public Number getKey() {
    if (this.keyList.size() == 0) {
      return null;
    }
    if (this.keyList.size() > 1 || this.keyList.get(0).size() > 1) {
      throw new DataAccessException("The getKey method should only be used when a single key is returned.  "
          + "The current key entry contains multiple keys: " + this.keyList);
    }
    Iterator<Object> keyIter = this.keyList.get(0).values().iterator();
    if (keyIter.hasNext()) {
      Object key = keyIter.next();
      if (!(key instanceof Number)) {
        throw new DataAccessException("The generated key is not of a supported numeric type. "
            + "Unable to cast [" + (key != null ? key.getClass().getName() : null) + "] to ["
            + Number.class.getName() + "]");
      }
      return (Number) key;
    } else {
      throw new DataAccessException("Unable to retrieve the generated key. "
          + "Check that the table has an identity column enabled.");
    }
  }
View Full Code Here

Examples of dao.DataAccessException

    }

    private static OrderListExpandedDTO performSearch(Integer pageNumber, Integer pageSize, OrderSearchDto searchDto) throws DataAccessException {
        List<Order> orders = DaoManager.getOrderDao().search(pageNumber - 1, pageSize, searchDto);
        if (orders == null) {
            throw new DataAccessException();
        }
        Integer totalOrders = DaoManager.getOrderDao().searchResultsCount(searchDto);
        Integer totalPages = Double.valueOf(Math.ceil((double) totalOrders / pageSize)).intValue();
        OrderListExpandedDTO ordersDto = OrderListExpandedDTO.createFrom(orders, totalPages);
        return ordersDto;
View Full Code Here

Examples of org.jamwiki.DataAccessException

  private static void initialize() throws DataAccessException {
    File file = null;
    try {
      file = Utilities.getClassLoaderFile(SPAM_BLACKLIST_FILE);
    } catch (IOException e) {
      throw new DataAccessException("I/O exception while initlaizing spam blacklist", e);
    }
    String regex = "";
    String regexText = null;
    try {
      regexText = FileUtils.readFileToString(file, "UTF-8").trim();
    } catch (IOException e) {
      throw new DataAccessException("I/O exception while initlaizing spam blacklist", e);
    }
    String[] tokens = regexText.split("\n");
    for (int i = 0; i < tokens.length; i++) {
      String token = tokens[i];
      if (StringUtils.isBlank(token)) {
        continue;
      }
      if (i > 0) {
        regex += "|";
      }
      regex += token.trim();
    }
    try {
      spamRegexPattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
    } catch (PatternSyntaxException e) {
      throw new DataAccessException("Failure while parsing spam regular expression list", e);
    }
    logger.info("Loading spam filter regular expression:" + regex);
  }
View Full Code Here

Examples of org.jooq.exception.DataAccessException

        try {
            log.debug("commit");
            connection.commit();
        }
        catch (Exception e) {
            throw new DataAccessException("Cannot commit transaction", e);
        }
    }
View Full Code Here

Examples of org.jooq.exception.DataAccessException

        try {
            log.debug("rollback");
            connection.rollback();
        }
        catch (Exception e) {
            throw new DataAccessException("Cannot rollback transaction", e);
        }
    }
View Full Code Here

Examples of org.jooq.exception.DataAccessException

        try {
            log.debug("rollback to savepoint");
            connection.rollback(savepoint);
        }
        catch (Exception e) {
            throw new DataAccessException("Cannot rollback transaction", e);
        }
    }
View Full Code Here

Examples of org.jooq.exception.DataAccessException

        try {
            log.debug("set savepoint");
            return connection.setSavepoint();
        }
        catch (Exception e) {
            throw new DataAccessException("Cannot set savepoint", e);
        }
    }
View Full Code Here

Examples of org.jooq.exception.DataAccessException

        try {
            log.debug("set savepoint", name);
            return connection.setSavepoint(name);
        }
        catch (Exception e) {
            throw new DataAccessException("Cannot set savepoint", e);
        }
    }
View Full Code Here

Examples of org.jooq.exception.DataAccessException

        try {
            log.debug("release savepoint");
            connection.releaseSavepoint(savepoint);
        }
        catch (Exception e) {
            throw new DataAccessException("Cannot release savepoint", e);
        }
    }
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.