Package org.firebirdsql.jca
Class FBResourceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
javax.resource.ResourceException
org.firebirdsql.jca.FBResourceException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FBIncorrectXidException,FBResourceTransactionException
public class FBResourceException
extends javax.resource.ResourceException
FBResourceException should be used in places where ResourceException should be thrown according to
the interface specification, but we do not want to lose the exception that we caught.
Example:
try {
// execute some code here
...
} catch(GDSException gdsex) {
throw new FBResourceException(gdsex);
}
- Author:
- Roman Rokytskyy
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFBResourceException(Exception original) Create a new instance ofFBResourceExceptionwith a generic error code that is linked to another (sub) exception.FBResourceException(String reason) Create a new instance ofFBResourceExceptionwith a given string message and generic error code.FBResourceException(String reason, Exception original) Create a new instance ofFBResourceExceptionwith a generic error code that is linked to another (sub) exception.FBResourceException(String reason, String errorCode) Create a new instance ofFBResourceExceptionwith a message and specific error code. -
Method Summary
Modifier and TypeMethodDescriptionGet message of this exception.voidPrint the stack trace of this exception toSTDERRvoidPrint the stack trace of this exception to a givenPrintStreamvoidPrint the stack trace of this exception to a givenPrintWriterMethods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, setErrorCode, setLinkedExceptionMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
Constructor Details
-
FBResourceException
Create a new instance ofFBResourceExceptionwith a given string message and generic error code.- Parameters:
reason- The string message for the exception
-
FBResourceException
Create a new instance ofFBResourceExceptionwith a message and specific error code.- Parameters:
reason- The string message for the exceptionerrorCode- The error code for the cause of the exception
-
FBResourceException
Create a new instance ofFBResourceExceptionwith a generic error code that is linked to another (sub) exception.- Parameters:
reason- The string message for the exceptionoriginal- The original exception to which this instance is to be linked to
-
FBResourceException
Create a new instance ofFBResourceExceptionwith a generic error code that is linked to another (sub) exception.- Parameters:
original- The original exception to which this instance is to be linked to
-
-
Method Details
-
getMessage
Get message of this exception.- Overrides:
getMessagein classjavax.resource.ResourceException- Returns:
- combined message of this exception and original exception.
-
printStackTrace
public void printStackTrace()Print the stack trace of this exception toSTDERR- Overrides:
printStackTracein classThrowable
-
printStackTrace
Print the stack trace of this exception to a givenPrintStream- Overrides:
printStackTracein classThrowable- Parameters:
s- ThePrintStreamto which to write the stack trace
-
printStackTrace
Print the stack trace of this exception to a givenPrintWriter- Overrides:
printStackTracein classThrowable- Parameters:
s- ThePrintWriterto which to write the stack trace
-