Top Description Fields Constructors Methods
org.hsqldb.error

public final Class Error

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, org.hsqldb.HsqlException, org.hsqldb.lib.StringUtil, org.hsqldb.resources.ResourceBundleHandler, org.hsqldb.result.Result

Contains static factory methods to produce instances of HsqlException
Authors
Loic Lefevre, Fred Toussi (fredt@users dot sourceforge.net)
Since
1.9.0
Version
2.7.0

Field Summary

Modifier and TypeField and Description
private static final int
private static final String
private static final int
private static final String
private static final String
private static final int
private static final int
public static boolean
public static boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static HsqlException
error(int code, String add)

public static HsqlException
error(Throwable t, int code, String add)

public static HsqlException
error(int code)

public static HsqlException
error(int code, Throwable t)

public static HsqlException

Returns:

an HsqlException
error
(Throwable t, int
main error code
code
,
int
sub error code (if 0 then no subMessage!)
subCode
,
final String[]
optional parameters
add
)

Compose error message by inserting the strings in the add parameters in placeholders within the error message.

public static HsqlException
error(int code, int code2)

public static HsqlException

Returns:

an HsqlException
error
(String message, String sqlState)

For SIGNAL and RESIGNAL

public static HsqlException
error(final Result result)

public static int
getCode(String sqlState)

public static String

Returns:

the error message associated with the error code
getMessage
(final int
the error code associated to the error message
errorCode
)

Returns the error message given the error code.

public static String

Returns:

the error message associated with the error code
getMessage
(final int
the code for the error message
code
,
int
the code for the addon message
subCode
,
final String[]
value(s) to use to replace the placeholer(s)
add
)

Returns the error message given the error code.

private static String
public static String

Returns:

the error message associated with the error code
getStateString
(final int
the error code associated to the error message
errorCode
)

Returns the error SQL STATE sting given the error code.

private static String

Returns:

an HsqlException
insertStrings
(String
message string
message
,
String[]
optional parameters
add
)

Compose error message by inserting the strings in the add variables in placeholders within the error message.

public static HsqlException
parseError(int code, String add, int lineNumber)

public static HsqlException
parseError(int code, int subCode, int lineNumber, final String[] add)

public static void
printSystemOut(String
message to print
message
)

Used to print messages to System.out

public static RuntimeException
runtimeError(int code, String add)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bundleHandleback to summary
private static final int bundleHandle
defaultMessageback to summary
private static final String defaultMessage
ERROR_CODE_BASEback to summary
private static final int ERROR_CODE_BASE
errPropsNameback to summary
private static final String errPropsName
MESSAGE_TAGback to summary
private static final String MESSAGE_TAG
SQL_CODE_DIGITSback to summary
private static final int SQL_CODE_DIGITS
SQL_STATE_DIGITSback to summary
private static final int SQL_STATE_DIGITS
TRACEback to summary
public static boolean TRACE
TRACESYSTEMOUTback to summary
public static boolean TRACESYSTEMOUT

Constructor Detail

Errorback to summary
public Error()

Method Detail

errorback to summary
public static HsqlException error(int code, String add)
errorback to summary
public static HsqlException error(Throwable t, int code, String add)
errorback to summary
public static HsqlException error(int code)
errorback to summary
public static HsqlException error(int code, Throwable t)
errorback to summary
public static HsqlException error(Throwable t, int code, int subCode, final String[] add)

Compose error message by inserting the strings in the add parameters in placeholders within the error message. The message string contains $$ markers for each context variable. Context variables are supplied in the add parameters.

Parameters
code:int

main error code

subCode:int

sub error code (if 0 then no subMessage!)

add:String[]

optional parameters

Returns:HsqlException

an HsqlException

errorback to summary
public static HsqlException error(int code, int code2)
errorback to summary
public static HsqlException error(String message, String sqlState)

For SIGNAL and RESIGNAL

Returns:HsqlException

an HsqlException

See Also
HsqlException#HsqlException(Throwable, String, String, int)
errorback to summary
public static HsqlException error(final Result result)
getCodeback to summary
public static int getCode(String sqlState)
getMessageback to summary
public static String getMessage(final int errorCode)

Returns the error message given the error code.

This method is to be used when throwing exception other than HsqlException.

Parameters
errorCode:int

the error code associated to the error message

Returns:String

the error message associated with the error code

getMessageback to summary
public static String getMessage(final int code, int subCode, final String[] add)

Returns the error message given the error code.

This method is used when throwing exception other than HsqlException.

Parameters
code:int

the code for the error message

subCode:int

the code for the addon message

add:String[]

value(s) to use to replace the placeholer(s)

Returns:String

the error message associated with the error code

getResourceStringback to summary
private static String getResourceString(int code)
getStateStringback to summary
public static String getStateString(final int errorCode)

Returns the error SQL STATE sting given the error code.

This method is to be used when throwing exception based on other exceptions.

Parameters
errorCode:int

the error code associated to the error message

Returns:String

the error message associated with the error code

insertStringsback to summary
private static String insertStrings(String message, String[] add)

Compose error message by inserting the strings in the add variables in placeholders within the error message. The message string contains $$ markers for each context variable. Context variables are supplied in the add parameter. (by Loic Lefevre)

Parameters
message:String

message string

add:String[]

optional parameters

Returns:String

an HsqlException

parseErrorback to summary
public static HsqlException parseError(int code, String add, int lineNumber)
parseErrorback to summary
public static HsqlException parseError(int code, int subCode, int lineNumber, final String[] add)
printSystemOutback to summary
public static void printSystemOut(String message)

Used to print messages to System.out

Parameters
message:String

message to print

runtimeErrorback to summary
public static RuntimeException runtimeError(int code, String add)