Package org.springframework.jdbc.support

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator


    private SQLExceptionTranslator exceptionTranslator;

    public SQLExceptionTranslatingThrowsAdvice(DataSource dataSource) {
        super();
        if (dataSource != null) {
            this.exceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(dataSource);
        }
        else {
            this.exceptionTranslator = new SQLStateSQLExceptionTranslator();
        }
    }
View Full Code Here


   * @param dbName the database product name that identifies the error codes entry
   * @see org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator#setDatabaseProductName
   * @see java.sql.DatabaseMetaData#getDatabaseProductName()
   */
  public void setDatabaseProductName(String dbName) {
    this.exceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(dbName);
  }
View Full Code Here

   */
  public SQLExceptionTranslator getExceptionTranslator() {
    if (this.exceptionTranslator == null) {
      DataSource ds = getDataSource();
      if (ds != null) {
        return new SQLErrorCodeSQLExceptionTranslator(ds);
      }
      return new SQLStateSQLExceptionTranslator();
    }
    return this.exceptionTranslator;
  }
View Full Code Here

   /**
    * Initializes the internal translator reference.
    */
   private synchronized void initExceptionTranslator() {
       if (this.exceptionTranslator == null) {
           this.exceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(this.dataSource);
       }
   }
View Full Code Here

  /**
   * Initializes the internal translator reference.
   */
  private synchronized void initExceptionTranslator() {
    if (this.exceptionTranslator == null) {
      this.exceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(this.dataSource);
    }
  }
View Full Code Here

  private static final long serialVersionUID = -2450323227461061152L;

  @Override
  public void exception(ExecuteContext ctx) {
    SQLDialect dialect = ctx.configuration().dialect();
    SQLExceptionTranslator translator = (dialect != null) ? new SQLErrorCodeSQLExceptionTranslator(dialect.name())
        : new SQLStateSQLExceptionTranslator();

    ctx.exception(translator.translate("jOOQ", ctx.sql(), ctx.sqlException()));
  }
View Full Code Here

    }

    private SQLExceptionTranslator translator() {
        return ds == null
            ? new SQLStateSQLExceptionTranslator()
            : new SQLErrorCodeSQLExceptionTranslator(ds);
    }
View Full Code Here

    @Override
    public void exception(ExecuteContext ctx) {
        SQLDialect dialect = ctx.configuration().dialect();
        SQLExceptionTranslator translator = (dialect != null)
                ? new SQLErrorCodeSQLExceptionTranslator(dialect.name())
                : new SQLStateSQLExceptionTranslator();

        ctx.exception(translator.translate("jOOQ", ctx.sql(), ctx.sqlException()));
    }
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

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.