Examples of DataAccessResourceFailureException


Examples of org.springframework.dao.DataAccessResourceFailureException

          logTranslation(task, sql, sqlExToUse, false);
          return new InvalidResultSetAccessException(task, sql, sqlExToUse);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getDataAccessResourceFailureCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlExToUse, false);
          return new DataAccessResourceFailureException(buildMessage(task, sql, sqlExToUse), sqlExToUse);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getPermissionDeniedCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlExToUse, false);
          return new PermissionDeniedDataAccessException(buildMessage(task, sql, sqlExToUse), sqlExToUse);
        }
View Full Code Here

Examples of org.springframework.dao.DataAccessResourceFailureException

        for (int i = 0; i < getCacheSize(); i++) {
          stmt.executeUpdate("insert into " + getIncrementerName() + " values(null)");
          ResultSet rs = stmt.executeQuery("select max(identity()) from " + getIncrementerName());
          try {
            if (!rs.next()) {
              throw new DataAccessResourceFailureException("identity() failed after executing an update");
            }
            this.valueCache[i] = rs.getLong(1);
          }
          finally {
            JdbcUtils.closeResultSet(rs);
          }
        }
        long maxValue = this.valueCache[(this.valueCache.length - 1)];
        stmt.executeUpdate("delete from " + getIncrementerName() + " where " + this.columnName + " < " + maxValue);
      }
      catch (SQLException ex) {
        throw new DataAccessResourceFailureException("Could not obtain identity()", ex);
      }
      finally {
        JdbcUtils.closeStatement(stmt);
        DataSourceUtils.releaseConnection(con, getDataSource());
      }
View Full Code Here

Examples of org.springframework.dao.DataAccessResourceFailureException

        for (int i = 0; i < getCacheSize(); i++) {
          stmt.executeUpdate("insert into " + getIncrementerName() + " (" + getDummyName() + ") values(null)");
          ResultSet rs = stmt.executeQuery("select IDENTITY_VAL_LOCAL() from " + getIncrementerName());
          try {
            if (!rs.next()) {
              throw new DataAccessResourceFailureException("IDENTITY_VAL_LOCAL() failed after executing an update");
            }
            this.valueCache[i] = rs.getLong(1);
          }
          finally {
            JdbcUtils.closeResultSet(rs);
          }
        }
        long maxValue = this.valueCache[(this.valueCache.length - 1)];
        stmt.executeUpdate("delete from " + getIncrementerName() + " where " + this.columnName + " < " + maxValue);
      }
      catch (SQLException ex) {
        throw new DataAccessResourceFailureException("Could not obtain IDENTITY value", ex);
      }
      finally {
        JdbcUtils.closeStatement(stmt);
        DataSourceUtils.releaseConnection(con, getDataSource());
      }
View Full Code Here

Examples of org.springframework.dao.DataAccessResourceFailureException

        provider = CallMetaDataProviderFactory.createMetaDataProvider(dataSource, context);
      }
     
      return provider;
    }catch (MetaDataAccessException ex) {
      throw new DataAccessResourceFailureException("Error retreiving database metadata", ex)//$NON-NLS-1$
    }
  }
View Full Code Here

Examples of org.springframework.dao.DataAccessResourceFailureException

      if (logger.isInfoEnabled()) {
        logger.info("Done executing SQL scriptBuilder from " + resource + " in " + elapsedTime + " ms.");
      }
    }
    catch (IOException ex) {
      throw new DataAccessResourceFailureException("Failed to open SQL script from " + resource, ex);
    }
  }
View Full Code Here

Examples of org.springframework.dao.DataAccessResourceFailureException

      }
      long elapsedTime = System.currentTimeMillis() - startTime;
      logger.info("Done executing SQL scriptBuilder '" + sqlResourcePath + "' in " + elapsedTime + " ms");
    }
    catch (IOException ex) {
      throw new DataAccessResourceFailureException("Failed to open SQL script '" + sqlResourcePath + "'", ex);
    }
  }
View Full Code Here

Examples of org.springframework.dao.DataAccessResourceFailureException

                type = Constants.DB_VT_ORACLE;
           
            databaseType = type;
            return type;
        } catch (SQLException e) {
            throw new DataAccessResourceFailureException("Cannot get Vendor Type", e);
        } finally {
            releaseConnection(connection);
        }
    }
View Full Code Here

Examples of org.springframework.dao.DataAccessResourceFailureException

        }
            }

            return dbd;
        } catch (SQLException e) {
            throw new DataAccessResourceFailureException("Error getting Database description", e);
        } catch (RuntimeException e1){
            throw new DataAccessResourceFailureException("Error getting Database description", e1);
        } finally {
            releaseConnection(connection);
        }
    }
View Full Code Here

Examples of org.springframework.dao.DataAccessResourceFailureException

        Connection connection = this.getConnection();
        try {
            set = new DBDataSet(TableName, connection.getMetaData());
            return set;
        } catch (SQLException e) {
            throw new DataAccessResourceFailureException("Error getting database Table description on table: " + TableName, e);
        }
        finally {
            releaseConnection(connection);
        }
    }
View Full Code Here

Examples of org.springframework.dao.DataAccessResourceFailureException

        try {
            String result = connection.getMetaData().getDatabaseProductName();
            databaseName = result;
            return result;
        } catch (SQLException e) {
            throw new DataAccessResourceFailureException("Error getting database product name", e);
        }
        finally  {
            releaseConnection(connection);
        }
    }
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.