Package org.springframework.jdbc.support

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator


      if (resultSet == null) {
        try {
          this.statement.setBoolean(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.setShort(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.setString(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

                s.setPrev(null);
                this.cache.remove(s.getKey());
                try {
                    s.getHandle().close();
                } catch (java.sql.SQLException qq_SQLEx) {
                    throw new SQLErrorCodeSQLExceptionTranslator().translate("SQL tasks", "", qq_SQLEx );
                }

            }

        }
View Full Code Here

     * database type with a generic database type
     * @param e The exception that was thrown
     * @return
     */
    public static DataAccessException translateSQLException(SQLException e){
      return new SQLErrorCodeSQLExceptionTranslator().translate("SQL tasks", null, e );
    }
View Full Code Here

     * @return
     */
    public static DataAccessException translateSQLException(int dbType, SQLException e){
        switch (dbType) {
            case Constants.DB_VT_DB2:
                return new SQLErrorCodeSQLExceptionTranslator("DB2").translate("SQL tasks", null, e );
            case Constants.DB_VT_INFORMIX:
                return new SQLErrorCodeSQLExceptionTranslator("Informix").translate("SQL tasks", null, e );
            case Constants.DB_VT_INGRES:
                return new SQLErrorCodeSQLExceptionTranslator("PostgreSQL").translate("SQL tasks", null, e );
            case Constants.DB_VT_MYSQL:
                return new SQLErrorCodeSQLExceptionTranslator("MySQL").translate("SQL tasks", null, e );
            case Constants.DB_VT_ORACLE:
                return new SQLErrorCodeSQLExceptionTranslator("Oracle").translate("SQL tasks", null, e );
            case Constants.DB_VT_SYBASE:
                return new SQLErrorCodeSQLExceptionTranslator("Sybase").translate("SQL tasks", null, e );
            default:
                return new SQLErrorCodeSQLExceptionTranslator().translate("SQL tasks", null, e );
        }
    }
View Full Code Here

   * @see org.springframework.jdbc.support.SQLStateSQLExceptionTranslator
   */
  static SQLExceptionTranslator newJdbcExceptionTranslator(Object connectionFactory) {
    // Check for PersistenceManagerFactory's DataSource.
    if (connectionFactory instanceof DataSource) {
      return new SQLErrorCodeSQLExceptionTranslator((DataSource) connectionFactory);
    }
    else {
      return new SQLStateSQLExceptionTranslator();
    }
  }
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 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

   * @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

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.