com.northgateis.reality.realsql
Class RealError

java.lang.Object
 |
 +--com.northgateis.reality.realsql.RealError

public class RealError
extends java.lang.Object

This class is used to generate SQLExceptions based on SQLSTATE values defined by XOPEN SQL specification.


Field Summary
protected static int ERROR
           
protected static int IM001
           
protected static int IM002
           
protected static int IM003
           
protected static int IM004
           
protected static int IM005
           
protected static int IM006
           
protected static int IM007
           
protected static int IM008
           
protected static int IM009
           
protected static int J1001
           
protected static int J1002
           
protected static int J1003
           
protected static int J1004
           
protected static int J1005
           
protected static int J1006
           
protected static int J1007
           
protected static int J1008
           
protected static int J1009
           
protected static int J1010
           
protected static int J1011
           
protected static int J1012
           
protected static int J1013
           
protected static int J1014
           
protected static int J1015
           
protected static int J1016
           
protected static int J1017
           
protected static int J1018
           
protected static int J1019
           
protected static int J1020
           
protected static int J1021
           
protected static int NO_DATA_FOUND
           
protected static int R1001
           
protected static int R1002
           
protected static int R1003
           
protected static int R1004
           
protected static int R1005
           
protected static int R1006
           
protected static int S00000
           
protected static int S0001
           
protected static int S0002
           
protected static int S0011
           
protected static int S0012
           
protected static int S0021
           
protected static int S0022
           
protected static int S01000
           
protected static int S01002
           
protected static int S01004
           
protected static int S01006
           
protected static int S01S00
           
protected static int S01S02
           
protected static int S07001
           
protected static int S07006
           
protected static int S08001
           
protected static int S08002
           
protected static int S08003
           
protected static int S08004
           
protected static int S08007
           
protected static int S08S01
           
protected static int S1000
           
protected static int S1001
           
protected static int S1002
           
protected static int S1003
           
protected static int S1004
           
protected static int S1008
           
protected static int S1009
           
protected static int S1010
           
protected static int S1012
           
protected static int S1015
           
protected static int S1090
           
protected static int S1091
           
protected static int S1092
           
protected static int S1093
           
protected static int S1094
           
protected static int S1095
           
protected static int S1096
           
protected static int S1097
           
protected static int S1098
           
protected static int S1099
           
protected static int S1100
           
protected static int S1101
           
protected static int S1102
           
protected static int S1104
           
protected static int S1105
           
protected static int S1106
           
protected static int S1107
           
protected static int S1108
           
protected static int S1109
           
protected static int S1110
           
protected static int S1C00
           
protected static int S1DE0
           
protected static int S1T00
           
protected static int S21S01
           
protected static int S21S02
           
protected static int S22001
           
protected static int S22003
           
protected static int S22005
           
protected static int S22008
           
protected static int S22012
           
protected static int S22026
           
protected static int S23000
           
protected static int S24000
           
protected static int S25000
           
protected static int S28000
           
protected static int S34000
           
protected static int S37000
           
protected static int S3C000
           
protected static int S40001
           
protected static int S42000
           
protected static int S70100
           
protected static int SUCCESS
           
protected static int SUCCESS_INFO
           
 
Constructor Summary
protected RealError()
          Default constructor.
protected RealError(int errState)
          Generates a new RealSQLException with the SQLMessage and SQLState arguments defined by the parameter errState.
protected RealError(java.lang.String sqlMsg, int errState)
          Generates a new RealSQLException with the arguments defined by the parameters sqlMsg and errState.
protected RealError(java.lang.String serverMsg, int serverCode, int retCode)
          Generates a new RealSQLException with the arguments defined by the parameters serverMsg, serverCode, and retCode.
 
Method Summary
protected  intgetErrState(int realErrNo, int retCode)
          Translates the Reality server error message number into an appropriate SQLSTATE.
protected  RealSQLExceptiongetException()
          Get the exception generated when this object was created, if no exception exists a default exception (S1000 -> "General error.") is returned.
protected  java.lang.StringgetSqlState(int errState)
          Get the SQLSTATE defined by parameter errState.
protected  java.lang.StringgetSqlState(int realErrNo, int retCode)
          Translates the Reality server error message number into an appropriate SQLSTATE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

protected static final int SUCCESS

SUCCESS_INFO

protected static final int SUCCESS_INFO

ERROR

protected static final int ERROR

NO_DATA_FOUND

protected static final int NO_DATA_FOUND

S00000

protected static final int S00000

S01000

protected static final int S01000

S01002

protected static final int S01002

S01004

protected static final int S01004

S01006

protected static final int S01006

S01S00

protected static final int S01S00

S01S02

protected static final int S01S02

S07001

protected static final int S07001

S07006

protected static final int S07006

S08001

protected static final int S08001

S08002

protected static final int S08002

S08003

protected static final int S08003

S08004

protected static final int S08004

S08007

protected static final int S08007

S08S01

protected static final int S08S01

S21S01

protected static final int S21S01

S21S02

protected static final int S21S02

S22001

protected static final int S22001

S22003

protected static final int S22003

S22005

protected static final int S22005

S22008

protected static final int S22008

S22012

protected static final int S22012

S22026

protected static final int S22026

S23000

protected static final int S23000

S24000

protected static final int S24000

S25000

protected static final int S25000

S28000

protected static final int S28000

S34000

protected static final int S34000

S37000

protected static final int S37000

S3C000

protected static final int S3C000

S40001

protected static final int S40001

S42000

protected static final int S42000

S70100

protected static final int S70100

IM001

protected static final int IM001

IM002

protected static final int IM002

IM003

protected static final int IM003

IM004

protected static final int IM004

IM005

protected static final int IM005

IM006

protected static final int IM006

IM007

protected static final int IM007

IM008

protected static final int IM008

IM009

protected static final int IM009

S0001

protected static final int S0001

S0002

protected static final int S0002

S0011

protected static final int S0011

S0012

protected static final int S0012

S0021

protected static final int S0021

S0022

protected static final int S0022

S1000

protected static final int S1000

S1001

protected static final int S1001

S1002

protected static final int S1002

S1003

protected static final int S1003

S1004

protected static final int S1004

S1008

protected static final int S1008

S1009

protected static final int S1009

S1010

protected static final int S1010

S1012

protected static final int S1012

S1015

protected static final int S1015

S1090

protected static final int S1090

S1091

protected static final int S1091

S1092

protected static final int S1092

S1093

protected static final int S1093

S1094

protected static final int S1094

S1095

protected static final int S1095

S1096

protected static final int S1096

S1097

protected static final int S1097

S1098

protected static final int S1098

S1099

protected static final int S1099

S1100

protected static final int S1100

S1101

protected static final int S1101

S1102

protected static final int S1102

S1104

protected static final int S1104

S1105

protected static final int S1105

S1106

protected static final int S1106

S1107

protected static final int S1107

S1108

protected static final int S1108

S1109

protected static final int S1109

S1110

protected static final int S1110

S1C00

protected static final int S1C00

S1DE0

protected static final int S1DE0

S1T00

protected static final int S1T00

R1001

protected static final int R1001

R1002

protected static final int R1002

R1003

protected static final int R1003

R1004

protected static final int R1004

R1005

protected static final int R1005

R1006

protected static final int R1006

J1001

protected static final int J1001

J1002

protected static final int J1002

J1003

protected static final int J1003

J1004

protected static final int J1004

J1005

protected static final int J1005

J1006

protected static final int J1006

J1007

protected static final int J1007

J1008

protected static final int J1008

J1009

protected static final int J1009

J1010

protected static final int J1010

J1011

protected static final int J1011

J1012

protected static final int J1012

J1013

protected static final int J1013

J1014

protected static final int J1014

J1015

protected static final int J1015

J1016

protected static final int J1016

J1017

protected static final int J1017

J1018

protected static final int J1018

J1019

protected static final int J1019

J1020

protected static final int J1020

J1021

protected static final int J1021
Constructor Detail

RealError

protected RealError()
Default constructor.

RealError

protected RealError(int errState)
Generates a new RealSQLException with the SQLMessage and SQLState arguments defined by the parameter errState.

Example:
RealError(IM001)
Generates the exception:
RealSQLException( "Driver does not support this function.", "IM001")

RealError

protected RealError(java.lang.String sqlMsg,
 int errState)
Generates a new RealSQLException with the arguments defined by the parameters sqlMsg and errState.

Example:
RealError("Invalid operation.", IM001)
Generates the exception:
RealSQLException("Invalid operation.", "IM001")

RealError

protected RealError(java.lang.String serverMsg,
 int serverCode,
 int retCode)
 throws RealSQLException
Generates a new RealSQLException with the arguments defined by the parameters serverMsg, serverCode, and retCode.

Example:
RealError("Table X not found", 1708, 0)
Generates the exception:
RealSQLException("Table X not found", "S0002", 1708)
Method Detail

getException

protected RealSQLExceptiongetException()
Get the exception generated when this object was created, if no exception exists a default exception (S1000 -> "General error.") is returned.

Returns:
RealSQLException.


getSqlState

protected java.lang.String getSqlState(int errState)
Get the SQLSTATE defined by parameter errState.

Parameters:
errState - SQL error code.
Returns:
SQLSTATE in text form.


getSqlState

protected java.lang.String getSqlState(int realErrNo,
 int retCode)
Translates the Reality server error message number into an appropriate SQLSTATE.

Parameters:
realErrNo - Reality error message number.
retCode - Reality return code: REALSQL_SUCCESS_INFO or REALSQL_ERROR
Returns:
SQLSTATE in text form.


getErrState

protected int getErrState(int realErrNo,
 int retCode)
Translates the Reality server error message number into an appropriate SQLSTATE.

Parameters:
realErrNo - Reality error message number.
retCode - Reality return code: REALSQL_SUCCESS_INFO or REALSQL_ERROR
Returns:
SQLSTATE as an int value.