Java SQLException printExceptionAndRollback(Connection conn, Exception e)

Here you can find the source of printExceptionAndRollback(Connection conn, Exception e)

Description

print Exception And Rollback

License

Open Source License

Declaration

public static void printExceptionAndRollback(Connection conn, Exception e) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.Connection;
import java.sql.SQLException;

public class Main {
    public static void printExceptionAndRollback(Connection conn, Exception e) {
        printException(e);/*w w  w. j  a va  2  s  .  com*/
        try {
            if (conn != null)
                conn.rollback();
        } catch (SQLException ignore) {
        }
    }

    public static void printException(Exception e) {
        System.out.println("Exception caught! Exiting ..");
        System.out.println("error message: " + e.getMessage());
        e.printStackTrace();
    }
}

Related

  1. mergeException(List exceptions)
  2. mergeException(List exceptions)
  3. mergeSQLExceptionMsg(final StringBuilder msgBuilder, final SQLException e, final String prefix)
  4. oracleSessionHasBeenKilled(Exception exception)
  5. parseRemoteException(Throwable t)
  6. printExceptions(OutputStream os, SQLException sqlEx)
  7. printSQLException(SQLException e)
  8. printSQLException(SQLException e)
  9. printSQLException(SQLException ex)