TraceObject

The base class for objects that can print trace information about themselves.

Methods
static int getNextId(int type)
Get the next trace object id for this object type.
static int getNextId(int type)
Get the next trace object id for this object type.
Parameters:
type - the object type
Returns:
the new trace object id
static String quote(String s)
Format a string as a Java string literal.
static String quote(String s)
Format a string as a Java string literal.
Parameters:
s - the string to convert
Returns:
the Java string literal
static String quoteArray(String[] s)
Format a string array to the Java source code that represents this object.
static String quoteArray(String[] s)
Format a string array to the Java source code that represents this object.
Parameters:
s - the string array to convert
Returns:
the Java source code
static String quoteBigDecimal(BigDecimal x)
Format a big decimal to the Java source code that represents this object.
static String quoteBigDecimal(BigDecimal x)
Format a big decimal to the Java source code that represents this object.
Parameters:
x - the big decimal to convert
Returns:
the Java source code
static String quoteBytes(byte[] x)
Format a byte array to the Java source code that represents this object.
static String quoteBytes(byte[] x)
Format a byte array to the Java source code that represents this object.
Parameters:
x - the byte array to convert
Returns:
the Java source code
static String quoteDate(Date x)
Format a date to the Java source code that represents this object.
static String quoteDate(Date x)
Format a date to the Java source code that represents this object.
Parameters:
x - the date to convert
Returns:
the Java source code
static String quoteIntArray(int[] s)
Format an int array to the Java source code that represents this object.
static String quoteIntArray(int[] s)
Format an int array to the Java source code that represents this object.
Parameters:
s - the int array to convert
Returns:
the Java source code
static String quoteMap(Map map)
Format a map to the Java source code that represents this object.
static String quoteMap(Map map)
Format a map to the Java source code that represents this object.
Parameters:
map - the map to convert
Returns:
the Java source code
static String quoteTime(Time x)
Format a time to the Java source code that represents this object.
static String quoteTime(Time x)
Format a time to the Java source code that represents this object.
Parameters:
x - the time to convert
Returns:
the Java source code
static String quoteTimestamp(Timestamp x)
Format a timestamp to the Java source code that represents this object.
static String quoteTimestamp(Timestamp x)
Format a timestamp to the Java source code that represents this object.
Parameters:
x - the timestamp to convert
Returns:
the Java source code
void debugCode(String text)
Write trace information in the form objectName.text.
void debugCode(String text)
Write trace information in the form objectName.text.
Parameters:
text - the trace text
void debugCodeAssign(String className, int newType, int newId, String value)
Write trace information as an assignment in the form className prefixId = objectName.value.
void debugCodeAssign(String className, int newType, int newId, String value)
Write trace information as an assignment in the form className prefixId = objectName.value.
Parameters:
className - the class name of the result
newType - the prefix type
newId - the trace object id of the created object
value - the value to assign this new object to
void debugCodeCall(String methodName)
Write trace information as a method call in the form objectName.methodName().
void debugCodeCall(String methodName)
Write trace information as a method call in the form objectName.methodName().
Parameters:
methodName - the method name
void debugCodeCall(String methodName, long param)
Write trace information as a method call in the form objectName.methodName(param) where the parameter is formatted as a long value.
void debugCodeCall(String methodName, long param)
Write trace information as a method call in the form objectName.methodName(param) where the parameter is formatted as a long value.
Parameters:
methodName - the method name
param - one single long parameter
void debugCodeCall(String methodName, String param)
Write trace information as a method call in the form objectName.methodName(param) where the parameter is formatted as a Java string.
void debugCodeCall(String methodName, String param)
Write trace information as a method call in the form objectName.methodName(param) where the parameter is formatted as a Java string.
Parameters:
methodName - the method name
param - one single string parameter
boolean isDebugEnabled()
Check if the debug trace level is enabled.
boolean isDebugEnabled()
Check if the debug trace level is enabled.
Returns:
true if it is
boolean isInfoEnabled()
Check if info trace level is enabled.
boolean isInfoEnabled()
Check if info trace level is enabled.
Returns:
true if it is
SQLException logAndConvert(Throwable ex)
Log an exception and convert it to a SQL exception if required.
SQLException logAndConvert(Throwable ex)
Log an exception and convert it to a SQL exception if required.
Parameters:
ex - the exception
Returns:
the SQL exception object
void setTrace(Trace trace, int type, int id)
Set the options to use when writing trace message.
void setTrace(Trace trace, int type, int id)
Set the options to use when writing trace message.
Parameters:
trace - the trace object
type - the trace object type
id - the trace object id
SQLException unsupported(String message)
Get a SQL exception meaning this feature is not supported.
SQLException unsupported(String message)
Get a SQL exception meaning this feature is not supported.
Parameters:
message - the message
Returns:
the SQL exception

Fields
static int ARRAY = 16
static int BLOB = 9
static int CALLABLE_STATEMENT = 0
static int CLOB = 10
static int CONNECTION = 1
static int DATABASE_META_DATA = 2
static int DATA_SOURCE = 12
static int PARAMETER_META_DATA = 11
static int PREPARED_STATEMENT = 3
static int RESULT_SET = 4
static int RESULT_SET_META_DATA = 5
static int SAVEPOINT = 6
static int STATEMENT = 8
static int XA_DATA_SOURCE = 13
static int XID = 15
static Trace trace

CALLABLE_STATEMENT = 0

The trace type id for callable statements.

CONNECTION = 1

The trace type id for connections.

CLOB = 10

The trace type id for clobs.

PARAMETER_META_DATA = 11

The trace type id for parameter meta data objects.

DATA_SOURCE = 12

The trace type id for data sources.

XA_DATA_SOURCE = 13

The trace type id for XA data sources.

XID = 15

The trace type id for transaction ids.

ARRAY = 16

The trace type id for array objects.

DATABASE_META_DATA = 2

The trace type id for database meta data objects.

PREPARED_STATEMENT = 3

The trace type id for prepared statements.

RESULT_SET = 4

The trace type id for result sets.

RESULT_SET_META_DATA = 5

The trace type id for result set meta data objects.

SAVEPOINT = 6

The trace type id for savepoint objects.

STATEMENT = 8

The trace type id for statements.

BLOB = 9

The trace type id for blobs.

trace

The trace module used by this object.