Package org.springframework.jdbc.support

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator


    }

    @Resource(name=BasePortalJpaDao.PERSISTENCE_UNIT_NAME)
    public void setDataSource(DataSource dataSource) {
        this.jdbcOperations = new JdbcTemplate(dataSource);
        this.exceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(dataSource);
    }
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

   */
  protected SQLExceptionTranslator getExceptionTranslator() {
    synchronized(this) {
      if (exceptionTranslator == null) {
        if (dataSource != null) {
          exceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(dataSource);
        }
        else {
          exceptionTranslator = new SQLStateSQLExceptionTranslator();
        }
      }
View Full Code Here

        SQLExceptionTranslator sqlStateSQLExceptionTranslator;

        if(dataSource != null) {
          sqlStateSQLExceptionTranslator = new SQLStateSQLExceptionTranslator();
        } else {
          sqlStateSQLExceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(dataSource);
        }

        throw sqlStateSQLExceptionTranslator.translate("SqlMapClient operation", null, ex);
      }
      finally {
View Full Code Here

        SQLExceptionTranslator sqlStateSQLExceptionTranslator;

        if(dataSource != null) {
          sqlStateSQLExceptionTranslator = new SQLStateSQLExceptionTranslator();
        } else {
          sqlStateSQLExceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(dataSource);
        }

        throw sqlStateSQLExceptionTranslator.translate("SqlMapClient operation", null, ex);
      }
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

            }

            try {
                return action.doInSqlMapClient(session);
            } catch (SQLException ex) {
                throw new SQLErrorCodeSQLExceptionTranslator().translate("SqlMapClient operation",
                        null, ex);
            } catch (Throwable t) {
                throw new UncategorizedCobarClientException(
                        "unknown excepton when performing data access operation.", t);
            } finally {
View Full Code Here

                throw new CannotGetJdbcConnectionException("Could not get JDBC Connection", e);
            }
            try {
                return action.doInSqlMapClient(session);
            } catch (SQLException ex) {
                throw new SQLErrorCodeSQLExceptionTranslator().translate("SqlMapClient operation",
                        null, ex);
            }
        } finally {
            session.close();
        }
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

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.