Package org.hibernate.exception

Examples of org.hibernate.exception.JDBCConnectionException


  @Test
  public void testExceptions()  {
    SQLException sqlEx = new SQLException("argh", "27");

    final JDBCConnectionException jcex = new JDBCConnectionException("mymsg", sqlEx);
    try {
      hibernateTemplate.execute(new HibernateCallback<Object>() {
        @Override
        public Object doInHibernate(Session session)  {
          throw jcex;
View Full Code Here


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

    final JDBCConnectionException jcex = new JDBCConnectionException("mymsg", sqlEx);
    try {
      hibernateTemplate.execute(new HibernateCallback<Object>() {
        @Override
        public Object doInHibernate(org.hibernate.Session session) throws HibernateException {
          throw jcex;
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

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.