org.firebirdsql.jca

Class FBResourceException

Known Direct Subclasses:
FBIncorrectXidException, FBResourceTransactionException

public class FBResourceException
extends 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

Field Summary

static String
SQL_STATE_GENERAL_ERROR

Constructor Summary

FBResourceException(Exception original)
Create a new instance of FBResourceException with a generic error code that is linked to another (sub) exception.
FBResourceException(String reason)
Create a new instance of FBResourceException with a given string message and generic error code.
FBResourceException(String reason, Exception original)
Create a new instance of FBResourceException with a generic error code that is linked to another (sub) exception.
FBResourceException(String reason, String errorCode)
Create a new instance of FBResourceException with a message and specific error code.

Method Summary

String
getMessage()
Get message of this exception.
void
printStackTrace()
Print the stack trace of this exception to STDERR
void
printStackTrace(PrintStream s)
Print the stack trace of this exception to a given PrintStream
void
printStackTrace(PrintWriter s)
Print the stack trace of this exception to a given PrintWriter

Field Details

SQL_STATE_GENERAL_ERROR

public static final String SQL_STATE_GENERAL_ERROR

Constructor Details

FBResourceException

public FBResourceException(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

FBResourceException

public FBResourceException(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(String reason,
                           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(String reason,
                           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

Method Details

getMessage

public String getMessage()
Get message of this exception.
Returns:
combined message of this exception and original exception.

printStackTrace

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

printStackTrace

public void printStackTrace(PrintStream s)
Print the stack trace of this exception to a given PrintStream
Parameters:
s - The PrintStream to which to write the stack trace

printStackTrace

public void printStackTrace(PrintWriter s)
Print the stack trace of this exception to a given PrintWriter
Parameters:
s - The PrintWriter to which to write the stack trace

Copyright B) 2001 David Jencks and other authors. All rights reserved.