Package org.hibernate.exception

Examples of org.hibernate.exception.SQLExceptionConverter.convert()


      fail("INSERT should have failed");
    }
    catch(SQLException sqle) {
      JDBCExceptionReporter.logExceptions(sqle, "Just output!!!!");
      JDBCException jdbcException = converter.convert(sqle, null, null);
      assertEquals( "Bad conversion [" + sqle.getMessage() + "]", ConstraintViolationException.class , jdbcException.getClass() );
      ConstraintViolationException ex = (ConstraintViolationException) jdbcException;
      System.out.println("Violated constraint name: " + ex.getConstraintName());
    }
    finally {
View Full Code Here


      ps.executeQuery();

      fail("SQL compilation should have failed");
    }
    catch( SQLException sqle ) {
      assertEquals( "Bad conversion [" + sqle.getMessage() + "]", SQLGrammarException.class, converter.convert(sqle, null, null).getClass() );
    }
    finally {
      if ( ps != null ) {
        try {
          ps.close();
View Full Code Here

      fail("INSERT should have failed");
    }
    catch(SQLException sqle) {
      JDBCExceptionReporter.logExceptions(sqle, "Just output!!!!");
      JDBCException jdbcException = converter.convert(sqle, null, null);
      assertEquals( "Bad conversion [" + sqle.getMessage() + "]", ConstraintViolationException.class , jdbcException.getClass() );
      ConstraintViolationException ex = (ConstraintViolationException) jdbcException;
      System.out.println("Violated constraint name: " + ex.getConstraintName());
    }
    finally {
View Full Code Here

      ps.executeQuery();

      fail("SQL compilation should have failed");
    }
    catch( SQLException sqle ) {
      assertEquals( "Bad conversion [" + sqle.getMessage() + "]", SQLGrammarException.class, converter.convert(sqle, null, null).getClass() );
    }
    finally {
      if ( ps != null ) {
        try {
          ps.close();
View Full Code Here

      fail("INSERT should have failed");
    }
    catch(SQLException sqle) {
      JDBCExceptionReporter.logExceptions(sqle, "Just output!!!!");
      JDBCException jdbcException = converter.convert(sqle, null, null);
      assertEquals( "Bad conversion [" + sqle.getMessage() + "]", ConstraintViolationException.class , jdbcException.getClass() );
      ConstraintViolationException ex = (ConstraintViolationException) jdbcException;
      System.out.println("Violated constraint name: " + ex.getConstraintName());
    }
    finally {
View Full Code Here

      ps.executeQuery();

      fail("SQL compilation should have failed");
    }
    catch( SQLException sqle ) {
      assertEquals( "Bad conversion [" + sqle.getMessage() + "]", SQLGrammarException.class, converter.convert(sqle, null, null).getClass() );
    }
    finally {
      if ( ps != null ) {
        try {
          ps.close();
View Full Code Here

      fail("INSERT should have failed");
    }
    catch(SQLException sqle) {
      JDBCExceptionReporter.logExceptions(sqle, "Just output!!!!");
      JDBCException jdbcException = converter.convert(sqle, null, null);
      assertEquals( "Bad conversion [" + sqle.getMessage() + "]", ConstraintViolationException.class , jdbcException.getClass() );
      ConstraintViolationException ex = (ConstraintViolationException) jdbcException;
      System.out.println("Violated constraint name: " + ex.getConstraintName());
    }
    finally {
View Full Code Here

      ps.executeQuery();

      fail("SQL compilation should have failed");
    }
    catch( SQLException sqle ) {
      assertEquals( "Bad conversion [" + sqle.getMessage() + "]", SQLGrammarException.class, converter.convert(sqle, null, null).getClass() );
    }
    finally {
      if ( ps != null ) {
        try {
          ps.close();
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.