Package org.springframework.jdbc.support

Examples of org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator


   * @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 #setJdbcExceptionTranslator
   */
  public synchronized SQLExceptionTranslator getJdbcExceptionTranslator() {
    if (this.jdbcExceptionTranslator == null) {
      if (getDataSource() != null) {
        this.jdbcExceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(getDataSource());
      }
      else {
        this.jdbcExceptionTranslator = 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

   * 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

      JdbcTemplate template2 = new JdbcTemplate();
      template2.setDataSource(mockDataSource);
      template2.setLazyInit(false);
      if (beanProperty) {
        // This will get a connection.
        template2.setExceptionTranslator(new SQLErrorCodeSQLExceptionTranslator(mockDataSource));
      }
      else {
        // This will cause creation of default SQL translator.
        // Note that only call should be effective.
        template2.afterPropertiesSet();
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

   * 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

    this.template = new JdbcTemplate();
    this.template.setDataSource(this.dataSource);
    this.template.setLazyInit(false);
    if (beanProperty) {
      // This will get a connection.
      this.template.setExceptionTranslator(new SQLErrorCodeSQLExceptionTranslator(this.dataSource));
    }
    else {
      // This will cause creation of default SQL translator.
      this.template.afterPropertiesSet();
    }
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.