Package org.springframework.dao

Examples of org.springframework.dao.InvalidDataAccessResourceUsageException


      logger.debug("The following parameters are used for call " + getInsertString() + " with: " + values);
    }
    final KeyHolder keyHolder = new GeneratedKeyHolder();
    if (!this.tableMetaDataContext.isGetGeneratedKeysSupported()) {
      if (!this.tableMetaDataContext.isGetGeneratedKeysSimulated()) {
        throw new InvalidDataAccessResourceUsageException(
            "The getGeneratedKeys feature is not supported by this database");
      }
      if (getGeneratedKeyNames().length < 1) {
        throw new InvalidDataAccessApiUsageException("Generated Key Name(s) not specificed. " +
            "Using the generated keys features requires specifying the name(s) of the generated column(s)");
View Full Code Here


  public static DataAccessException convertHibernateAccessException(HibernateException ex) {
    if (ex instanceof JDBCConnectionException) {
      return new DataAccessResourceFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof SQLGrammarException) {
      return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof DataException) {
      return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof LockAcquisitionException) {
      return new CannotAcquireLockException(ex.getMessage(), ex);
    }
    if (ex instanceof ConstraintViolationException) {
View Full Code Here

          },
          keyHolder);
    }
    else {
      if (!this.tableMetaDataContext.isGetGeneratedKeysSimulated()) {
        throw new InvalidDataAccessResourceUsageException(
            "The getGeneratedKeys feature is not supported by this database");
      }
      if (getGeneratedKeyNames().length < 1) {
        throw new InvalidDataAccessApiUsageException("Generated Key Name(s) not specificed. " +
            "Using the generated keys features requires specifying the name(s) of the generated column(s)");
View Full Code Here

          else {
            ps = con.prepareStatement(this.actualSql, PreparedStatement.RETURN_GENERATED_KEYS);
          }
        }
        catch (AbstractMethodError ex) {
          throw new InvalidDataAccessResourceUsageException(
              "The JDBC driver is not compliant to JDBC 3.0 and thus " +
              "does not support retrieval of auto-generated keys", ex);
        }
      }
      else if (resultSetType == ResultSet.TYPE_FORWARD_ONLY && !updatableResults) {
View Full Code Here

          },
          keyHolder);
    }
    else {
      if (!this.tableMetaDataContext.isGetGeneratedKeysSimulated()) {
        throw new InvalidDataAccessResourceUsageException(
            "The getGeneratedKeys feature is not supported by this database");
      }
      if (getGeneratedKeyNames().length < 1) {
        throw new InvalidDataAccessApiUsageException("Generated Key Name(s) not specificed. " +
            "Using the generated keys features requires specifying the name(s) of the generated column(s)");
View Full Code Here

  public static DataAccessException convertHibernateAccessException(HibernateException ex) {
    if (ex instanceof JDBCConnectionException) {
      return new DataAccessResourceFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof SQLGrammarException) {
      return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof LockAcquisitionException) {
      return new CannotAcquireLockException(ex.getMessage(), ex);
    }
    if (ex instanceof ConstraintViolationException) {
View Full Code Here

  public static DataAccessException convertHibernateAccessException(HibernateException ex) {
    if (ex instanceof JDBCConnectionException) {
      return new DataAccessResourceFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof SQLGrammarException) {
      return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
    }
    if (ex != null && "org.hibernate.exception.DataException".equals(ex.getClass().getName())) {
      return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof LockAcquisitionException) {
      return new CannotAcquireLockException(ex.getMessage(), ex);
    }
    if (ex instanceof ConstraintViolationException) {
View Full Code Here

          else {
            ps = con.prepareStatement(this.actualSql, PreparedStatement.RETURN_GENERATED_KEYS);
          }
        }
        catch (AbstractMethodError ex) {
          throw new InvalidDataAccessResourceUsageException(
              "The JDBC driver is not compliant to JDBC 3.0 and thus " +
              "does not support retrieval of auto-generated keys", ex);
        }
      }
      else if (resultSetType == ResultSet.TYPE_FORWARD_ONLY && !updatableResults) {
View Full Code Here

   *
   * @param ex JRedis exception
   * @return converted exception
   */
  public static DataAccessException convertJredisAccessException(ClientRuntimeException ex) {
    return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
  }
View Full Code Here

        try {
            String parametrizedQuery = QueryResultBuilder.replaceParams(statement,params);
            ExecutionResult result = parseAndExecuteQuery(parametrizedQuery);
            return new QueryResultBuilder<Map<String,Object>>(result,resultConverter);
        } catch (Exception e) {
            throw new InvalidDataAccessResourceUsageException("Error executing statement " + statement, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.springframework.dao.InvalidDataAccessResourceUsageException

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.