org.firebirdsql.jca
Class FBResourceException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by javax.resource.ResourceException
              extended by org.firebirdsql.jca.FBResourceException
All Implemented Interfaces:
java.io.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 loose exception that we caught.

Example:

 try {
     // execute some code here
     ...
 } catch(GDSException gdsex) {
     throw new FBResourceException(gdsex);
 }
 

Author:
Roman Rokytskyy
See Also:
Serialized Form

Field Summary
static java.lang.String SQL_STATE_GENERAL_ERROR
           
 
Constructor Summary
FBResourceException(java.lang.Exception original)
          Create a new instance of FBResourceException with a generic error code that is linked to another (sub) exception.
FBResourceException(java.lang.String reason)
          Create a new instance of FBResourceException with a given string message and generic error code.
FBResourceException(java.lang.String reason, java.lang.Exception original)
          Create a new instance of FBResourceException with a generic error code that is linked to another (sub) exception.
FBResourceException(java.lang.String reason, java.lang.String errorCode)
          Create a new instance of FBResourceException with a message and specific error code.
 
Method Summary
 java.lang.String getMessage()
          Get message of this exception.
 void printStackTrace()
          Print the stack trace of this exception to STDERR
 void printStackTrace(java.io.PrintStream s)
          Print the stack trace of this exception to a given PrintStream
 void printStackTrace(java.io.PrintWriter s)
          Print the stack trace of this exception to a given PrintWriter
 
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, setErrorCode, setLinkedException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SQL_STATE_GENERAL_ERROR

public static final java.lang.String SQL_STATE_GENERAL_ERROR
See Also:
Constant Field Values
Constructor Detail

FBResourceException

public FBResourceException(java.lang.String reason)
Create a new instance of FBResourceException with a given string message and generic error code.

Parameters:
reason - The string message for the exception

FBResourceException

public FBResourceException(java.lang.String reason,
                           java.lang.String errorCode)
Create a new instance of FBResourceException with a message and specific error code.

Parameters:
reason - The string message for the exception
errorCode - The error code for the cause of the exception

FBResourceException

public FBResourceException(java.lang.String reason,
                           java.lang.Exception original)
Create a new instance of FBResourceException with a generic error code that is linked to another (sub) exception.

Parameters:
reason - The string message for the exception
original - The original exception to which this instance is to be linked to

FBResourceException

public FBResourceException(java.lang.Exception original)
Create a new instance of FBResourceException with 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 Detail

getMessage

public java.lang.String getMessage()
Get message of this exception.

Overrides:
getMessage in class javax.resource.ResourceException
Returns:
combined message of this exception and original exception.

printStackTrace

public void printStackTrace()
Print the stack trace of this exception to STDERR

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream s)
Print the stack trace of this exception to a given PrintStream

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
s - The PrintStream to which to write the stack trace

printStackTrace

public void printStackTrace(java.io.PrintWriter s)
Print the stack trace of this exception to a given PrintWriter

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
s - The PrintWriter to which to write the stack trace


Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.