Examples of SQLErrorCodeSQLExceptionTranslator


Examples of cn.org.rapid_framework.generator.util.sqlerrorcode.SQLErrorCodeSQLExceptionTranslator

      throw new SQLException(message,e.getSQLState(),e.getErrorCode());
    }
  }

    private String getErrorCodeTranslatorDataBaaseName() {
        SQLErrorCodeSQLExceptionTranslator transaltor = SQLErrorCodeSQLExceptionTranslator.getSQLErrorCodeSQLExceptionTranslator(DataSourceProvider.getDataSource());
        if(transaltor.getSqlErrorCodes() == null) return "null";
        return Arrays.toString(transaltor.getSqlErrorCodes().getDatabaseProductNames());
    }
View Full Code Here

Examples of cn.org.rapid_framework.generator.util.sqlerrorcode.SQLErrorCodeSQLExceptionTranslator

        return Arrays.toString(transaltor.getSqlErrorCodes().getDatabaseProductNames());
    }

    /** 判断是否是外键,完整性约束等异常 引发的异常 */
    protected boolean isDataIntegrityViolationException(SQLException sqlEx) {
        SQLErrorCodeSQLExceptionTranslator transaltor = SQLErrorCodeSQLExceptionTranslator.getSQLErrorCodeSQLExceptionTranslator(DataSourceProvider.getDataSource());
        return transaltor.isDataIntegrityViolation(sqlEx);
  }
View Full Code Here

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

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator

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

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator

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

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator

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

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator

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

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator

  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

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator

    }

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

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator

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