Package org.hibernate.exception

Examples of org.hibernate.exception.JDBCConnectionException


  public JDBCException convert(SQLException sqlException, String message, String sql) {
    if ( SQLClientInfoException.class.isInstance( sqlException )
        || SQLInvalidAuthorizationSpecException.class.isInstance( sqlException )
        || SQLNonTransientConnectionException.class.isInstance( sqlException )
        || SQLTransientConnectionException.class.isInstance( sqlException ) ) {
      return new JDBCConnectionException( message, sqlException, sql );
    }
    else if ( DataTruncation.class.isInstance( sqlException ) ||
        SQLDataException.class.isInstance( sqlException ) ) {
      throw new DataException( message, sqlException, sql );
    }
View Full Code Here


              .getViolatedConstraintNameExtracter()
              .extractConstraintName( sqlException );
          return new ConstraintViolationException( message, sqlException, sql, constraintName );
        }
        else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) {
          return new JDBCConnectionException( message, sqlException, sql );
        }
        else if ( DATA_CATEGORIES.contains( sqlStateClassCode ) ) {
          return new DataException( message, sqlException, sql );
        }
      }
View Full Code Here

  public JDBCException convert(SQLException sqlException, String message, String sql) {
    if ( SQLClientInfoException.class.isInstance( sqlException )
        || SQLInvalidAuthorizationSpecException.class.isInstance( sqlException )
        || SQLNonTransientConnectionException.class.isInstance( sqlException )
        || SQLTransientConnectionException.class.isInstance( sqlException ) ) {
      return new JDBCConnectionException( message, sqlException, sql );
    }
    else if ( DataTruncation.class.isInstance( sqlException ) ||
        SQLDataException.class.isInstance( sqlException ) ) {
      throw new DataException( message, sqlException, sql );
    }
View Full Code Here

              .getViolatedConstraintNameExtracter()
              .extractConstraintName( sqlException );
          return new ConstraintViolationException( message, sqlException, sql, constraintName );
        }
        else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) {
          return new JDBCConnectionException( message, sqlException, sql );
        }
        else if ( DATA_CATEGORIES.contains( sqlStateClassCode ) ) {
          return new DataException( message, sqlException, sql );
        }
      }
View Full Code Here

  public JDBCException convert(SQLException sqlException, String message, String sql) {
    if ( SQLClientInfoException.class.isInstance( sqlException )
        || SQLInvalidAuthorizationSpecException.class.isInstance( sqlException )
        || SQLNonTransientConnectionException.class.isInstance( sqlException )
        || SQLTransientConnectionException.class.isInstance( sqlException ) ) {
      return new JDBCConnectionException( message, sqlException, sql );
    }
    else if ( DataTruncation.class.isInstance( sqlException ) ||
        SQLDataException.class.isInstance( sqlException ) ) {
      throw new DataException( message, sqlException, sql );
    }
View Full Code Here

  }

  public void testExceptions() throws HibernateException {
    SQLException sqlEx = new SQLException("argh", "27");

    final JDBCConnectionException jcex = new JDBCConnectionException("mymsg", sqlEx);
    try {
      createTemplate().execute(new HibernateCallback() {
        public Object doInHibernate(org.hibernate.Session session) throws HibernateException {
          throw jcex;
        }
View Full Code Here

      else if ( INTEGRITY_VIOLATION_CATEGORIES.contains( errorCode ) ) {
        String constraintName = extracter.extractConstraintName( sqlException );
        return new ConstraintViolationException( message, sqlException, sql, constraintName );
      }
      else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) {
        return new JDBCConnectionException( message, sqlException, sql );
      }
      else if ( DATA_CATEGORIES.contains( sqlStateClassCode ) ) {
        return new DataException( message, sqlException, sql );
      }
    }
View Full Code Here

        else if ( INTEGRITY_VIOLATION_CATEGORIES.contains( sqlStateClassCode ) ) {
          String constraintName = extracter.extractConstraintName( sqlException );
          return new ConstraintViolationException( message, sqlException, sql, constraintName );
        }
        else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) {
          return new JDBCConnectionException( message, sqlException, sql );
        }
        else if ( DATA_CATEGORIES.contains( sqlStateClassCode ) ) {
          return new DataException( message, sqlException, sql );
        }
      }
View Full Code Here

              .getViolatedConstraintNameExtracter()
              .extractConstraintName( sqlException );
          return new ConstraintViolationException( message, sqlException, sql, constraintName );
        }
        else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) {
          return new JDBCConnectionException( message, sqlException, sql );
        }
        else if ( DATA_CATEGORIES.contains( sqlStateClassCode ) ) {
          return new DataException( message, sqlException, sql );
        }
      }
View Full Code Here

      else if ( INTEGRITY_VIOLATION_CATEGORIES.contains( errorCode ) ) {
        String constraintName = extracter.extractConstraintName( sqlException );
        return new ConstraintViolationException( message, sqlException, sql, constraintName );
      }
      else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) {
        return new JDBCConnectionException( message, sqlException, sql );
      }
      else if ( DATA_CATEGORIES.contains( sqlStateClassCode ) ) {
        return new DataException( message, sqlException, sql );
      }
    }
View Full Code Here

TOP

Related Classes of org.hibernate.exception.JDBCConnectionException

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.