## org.firebirdsql.gds
Class GDSException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              org.firebirdsql.gds.GDSException

All Implemented Interfaces:
  Serializable

Direct Known Subclasses:
  GDSServerVersionException

    public class GDSException

extends Exception

A GDS-specific exception

Author:
  David Jencks, Roman Rokytskyy
See Also:
  Serialized Form

Field Summary
`protected int` `intParam`
`protected GDSException` `next` My child
`protected String` `strParam`
`protected int` `type`
`protected int` `xaErrorCode` The variable `xaErrorCode` is used to allow the same code to be used for transaction control from the XAResource, LocalTransaction, and Connection.

Constructor Summary
`GDSException(int fbErrorCode)` Create a new instance.
`GDSException(int type, int intParam)` Create a new instance.
`GDSException(int type, int fbErrorCode, String strParam)` Construct instance of this class.
`GDSException(int type, String strParam)` Create a new instance.
`GDSException(String message)` Create a new instance with only a simple message.

Method Summary
`static GDSException` `createWithXAErrorCode(String message, int xaErrorCode)` Factory method to create a new instance with a given `XA` error code.
`int` `getFbErrorCode()` Get the Firebird-specific error code for this exception.
`int` `getIntParam()` Get the `int` parameter for this exception.
`String` `getMessage()` Returns a string representation of this exception.
`GDSException` `getNext()` Get the next chained exception.
`String` `getParam()` Returns the parameter depending on the type of the error code.
`int` `getXAErrorCode()` Get the XaErrorCode value.
`boolean` `isWarning()` Retrieve whether this exception is a warning.
`void` `setNext(GDSException e)` Set the next exception in the chain.
`void` `setXAErrorCode(int xaErrorCode)` Set the XaErrorCode value.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### type

    protected int type

### intParam

    protected int intParam

### strParam

    protected String strParam

### xaErrorCode

    protected int xaErrorCode

  The variable `xaErrorCode` is used to allow the same code to be used for transaction control from the XAResource, LocalTransaction, and Connection. This code may be added to the GDSException without obscuring the message: only at the final level is the GDSException converted to the spec-required exception.

### next

    protected GDSException next

  My child

Constructor Detail

### GDSException

    public GDSException(int type,
                        int intParam)

  Create a new instance.

  Parameters:
    `type` - type of the exception, should be always `ISCConstants.isc_arg_gds`, otherwise no message will be displayed.
    `intParam` - Additional int parameter about the new exception

### GDSException

    public GDSException(int type,
                        String strParam)

  Create a new instance.

  Parameters:
    `type` - type of the exception, should be always `ISCConstants.isc_arg_gds`, otherwise no message will be displayed.
    `strParam` - value of the string parameter that will substitute `{0}` entry in error message corresponding to the specified error code.

### GDSException

    public GDSException(int type,
                        int fbErrorCode,
                        String strParam)

  Construct instance of this class. This method correctly constructs chain of exceptions for one string parameter.

  Parameters:
    `type` - type of the exception, should be always `ISCConstants.isc_arg_gds`, otherwise no message will be displayed.
    `fbErrorCode` - Firebird error code, one of the constants declared in `GDS` interface.
    `strParam` - value of the string parameter that will substitute `{0}` entry in error message corresponding to the specified error code.

### GDSException

    public GDSException(int fbErrorCode)

  Create a new instance.

  Parameters:
    `fbErrorCode` - Firebird error code, one of the constants declared in `GDS` interface

### GDSException

    public GDSException(String message)

  Create a new instance with only a simple message.

  Parameters:
    `message` - Message for the new exception

Method Detail

### createWithXAErrorCode

    public static GDSException createWithXAErrorCode(String message,
                                                     int xaErrorCode)

  Factory method to create a new instance with a given `XA` error code.

  Parameters:
    `message` - Message for the new instance
    `xaErrorCode` - The `XA` error code

### getFbErrorCode

    public int getFbErrorCode()

  Get the Firebird-specific error code for this exception.

  Returns:
    The Firebird error code

### getIntParam

    public int getIntParam()

  Get the `int` parameter for this exception.

  Returns:
    The `int` parameter

### getXAErrorCode

    public int getXAErrorCode()

  Get the XaErrorCode value.

  Returns:
    the XaErrorCode value.

### setXAErrorCode

    public void setXAErrorCode(int xaErrorCode)

  Set the XaErrorCode value.

  Parameters:
    `xaErrorCode` - The new XaErrorCode value.

### setNext

    public void setNext(GDSException e)

  Set the next exception in the chain.

  Parameters:
    `e` - The next chained exception

### getNext

    public GDSException getNext()

  Get the next chained exception.

  Returns:
    The next chained exception

### isWarning

    public boolean isWarning()

  Retrieve whether this exception is a warning.

  Returns:
    `true` if this is a warning, `false` otherwise

### getMessage

    public String getMessage()

  Returns a string representation of this exception.

  Overrides:
    `getMessage` in class `Throwable`

### getParam

    public String getParam()

  Returns the parameter depending on the type of the error code.

Copyright © 2001-2010. All Rights Reserved.