Module org.firebirdsql.jaybird
Package org.firebirdsql.gds

# Class GDSExceptionHelper

java.lang.Object
org.firebirdsql.gds.GDSExceptionHelper

public final class GDSExceptionHelper extends Object
This class returns messages for the specified error code.

This loads all messages during class initialization.

Author:
  David Jencks, Roman Rokytskyy, Blas Rodriguez Somoza, Mark Rotteveel

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final class`
`GDSExceptionHelper.GDSMessage`
This class wraps message template obtained from isc_error_msg.properties file and allows to set parameters to the message.

## Method Summary

Modifier and Type
Method
Description
`static GDSExceptionHelper.GDSMessage`
`getMessage(int code)`
This method returns a message for the specified error code.
`static String`
`getSQLState(int code)`
Get the SQL state for the specified error code.
`static String`
`getSQLState(int code, String defaultSQLState)`
Get the SQL state for the specified error code.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### getMessage

public static GDSExceptionHelper.GDSMessage getMessage(int code)
This method returns a message for the specified error code.

Parameters:
  `code` - Firebird error code
Returns:
  instance of `GDSExceptionHelper.GDSMessage` class where you can set desired parameters.

### getSQLState

public static String getSQLState(int code)
Get the SQL state for the specified error code.

Parameters:
  `code` - Firebird error code
Returns:
  SQL state for the Firebird error code, "HY000" if nothing found.

### getSQLState

public static String getSQLState(int code, String defaultSQLState)
Get the SQL state for the specified error code.

Parameters:
  `code` - Firebird error code
  `defaultSQLState` - The default SQLState to return
Returns:
  SQL state for the Firebird error code, or `defaultSQLState` if nothing found.