Class SQLExceptionUtils


  • public class SQLExceptionUtils
    extends Object
    • Method Detail

      • unwrapAndCheckForCode

        public static boolean unwrapAndCheckForCode​(Throwable t,
                                                    int errorCode)
        Checks the thrown exception and all parent exceptions and returns true if a SQLException with a matching error code is found.
        Parameters:
        t - The SQLException to check
        errorCode - The error code to check for.
        Returns:
        True if the exception or any parent exception is a SQL Exception and getErrorCode matches the error code. Otherwise, false.