Java SQLException unboxException(SQLException exception)

Here you can find the source of unboxException(SQLException exception)

Description

unbox Exception

License

Apache License

Declaration

public static SQLException unboxException(SQLException exception) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.SQLException;

public class Main {
    public static SQLException unboxException(SQLException exception) {
        final Throwable cause = exception.getCause();
        if (cause == null || !(cause instanceof RuntimeException)) {
            return exception;
        }/*w w w.  j  ava 2s .  c  om*/
        SQLException unboxed = new SQLException(exception.getMessage());
        unboxed.setStackTrace(exception.getStackTrace());
        return unboxed;
    }
}

Related

  1. retrieveDetailException(Throwable throwable)
  2. rollbackTransaction(final Connection conn, final SQLException e)
  3. throwException(final Throwable t)
  4. throwException(String message)
  5. toSQLException(Throwable e)