Package org.springframework.jdbc.support

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator


   * for the SessionFactory's underlying DataSource.
   */
  protected synchronized SQLExceptionTranslator getDefaultJdbcExceptionTranslator() {
    if (this.defaultJdbcExceptionTranslator == null) {
      if (getDataSource() != null) {
        this.defaultJdbcExceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(getDataSource());
      }
      else {
        this.defaultJdbcExceptionTranslator = SessionFactoryUtils.newJdbcExceptionTranslator(getSessionFactory());
      }
    }
View Full Code Here


   
                if (!(this.getStatementCache().getOn())) {
                    try {
                        statement.getHandle().close();
                    } catch (java.sql.SQLException qq_SQLEx) {
                        throw new SQLErrorCodeSQLExceptionTranslator().translate("SQL tasks", "", qq_SQLEx );
                    }
                }
   
            }
        }
        catch (SQLException e) {
            DataAccessException qq_dae = new SQLErrorCodeSQLExceptionTranslator().translate("SQL tasks", "", e );
            ErrorMgr.addError(e);
            ErrorMgr.addError(qq_dae);
            throw qq_dae;
        }
    }
View Full Code Here

   
                if (!(this.getStatementCache().getOn())) {
                    try {
                        statement.getHandle().close();
                    } catch (java.sql.SQLException qq_SQLEx) {
                        throw new SQLErrorCodeSQLExceptionTranslator().translate("SQL tasks", "", qq_SQLEx );
                    }
                }
   
            }
   
            return result;
        }
        catch (SQLException e) {
            DataAccessException qq_dae = new SQLErrorCodeSQLExceptionTranslator().translate("SQL tasks", "", e );
            ErrorMgr.addError(e);
            ErrorMgr.addError(qq_dae);
            throw qq_dae;
        }
    }
View Full Code Here

   * @see org.springframework.jdbc.support.SQLStateSQLExceptionTranslator
   */
  public static SQLExceptionTranslator newJdbcExceptionTranslator(SessionFactory sessionFactory) {
    DataSource ds = getDataSource(sessionFactory);
    if (ds != null) {
      return new SQLErrorCodeSQLExceptionTranslator(ds);
    }
    return new SQLStateSQLExceptionTranslator();
  }
View Full Code Here

                for (int i = 1; i <= numCols; i++) {
                    cds.add(new DBColumnDesc(data, i));
                }
            }
        } catch (SQLException e) {
            DataAccessException errorVar = new SQLErrorCodeSQLExceptionTranslator().translate("Cannot get column List from result set\n" + e.getMessage(), "", e );
            ErrorMgr.addError(errorVar);
            throw errorVar;
            // PM:16/07/2008
        } catch (NullPointerException e){
          String msg = (e.getMessage() == null) ? e.getClass().getName() : e.getMessage();
View Full Code Here

      if (resultSet == null) {
        try {
          setter.setParameterValue(this.statement, pColOrdinal, SqlTypeValue.TYPE_UNKNOWN, null, pValue);
        }
        catch (SQLException e) {
          DataAccessException errorVar = new SQLErrorCodeSQLExceptionTranslator().translate("DBDataSet.setValue(" + pColOrdinal +"," + pValue + ")", "", e );
          ErrorMgr.addError(errorVar);
          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
View Full Code Here

      if (resultSet == null) {
        try {
          this.statement.setInt(pColOrdinal, pValue);
        }
        catch (SQLException e) {
          DataAccessException errorVar = new SQLErrorCodeSQLExceptionTranslator().translate("DBDataSet.setValue(" + pColOrdinal +"," + pValue + ")", "", e );
          ErrorMgr.addError(errorVar);
          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
View Full Code Here

      if (resultSet == null) {
        try {
          this.statement.setFloat(pColOrdinal, pValue);
        }
        catch (SQLException e) {
          DataAccessException errorVar = new SQLErrorCodeSQLExceptionTranslator().translate("DBDataSet.setValue(" + pColOrdinal +"," + pValue + ")", "", e );
          ErrorMgr.addError(errorVar);
          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
View Full Code Here

      if (resultSet == null) {
        try {
          this.statement.setDouble(pColOrdinal, pValue);
        }
        catch (SQLException e) {
          DataAccessException errorVar = new SQLErrorCodeSQLExceptionTranslator().translate("DBDataSet.setValue(" + pColOrdinal +"," + pValue + ")", "", e );
          ErrorMgr.addError(errorVar);
          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
View Full Code Here

      if (resultSet == null) {
        try {
          this.statement.setLong(pColOrdinal, pValue);
        }
        catch (SQLException e) {
          DataAccessException errorVar = new SQLErrorCodeSQLExceptionTranslator().translate("DBDataSet.setValue(" + pColOrdinal +"," + pValue + ")", "", e );
          ErrorMgr.addError(errorVar);
          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator

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.