public class TraceObject
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
ARRAY
The trace type id for array objects.
|
protected static int |
BLOB
The trace type id for blobs.
|
protected static int |
CALLABLE_STATEMENT
The trace type id for callable statements.
|
protected static int |
CLOB
The trace type id for clobs.
|
protected static int |
CONNECTION
The trace type id for connections.
|
protected static int |
DATA_SOURCE
The trace type id for data sources.
|
protected static int |
DATABASE_META_DATA
The trace type id for database meta data objects.
|
protected static int |
PARAMETER_META_DATA
The trace type id for parameter meta data objects.
|
protected static int |
PREPARED_STATEMENT
The trace type id for prepared statements.
|
protected static int |
RESULT_SET
The trace type id for result sets.
|
protected static int |
RESULT_SET_META_DATA
The trace type id for result set meta data objects.
|
protected static int |
SAVEPOINT
The trace type id for savepoint objects.
|
protected static int |
STATEMENT
The trace type id for statements.
|
protected Trace |
trace
The trace module used by this object.
|
protected static int |
XA_DATA_SOURCE
The trace type id for XA data sources.
|
protected static int |
XID
The trace type id for transaction ids.
|
| Constructor and Description |
|---|
TraceObject() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
debugCode(java.lang.String text)
Write trace information in the form objectName.text.
|
protected void |
debugCodeAssign(java.lang.String className,
int newType,
int newId,
java.lang.String value)
Write trace information as an assignment in the form
className prefixId = objectName.value.
|
protected void |
debugCodeCall(java.lang.String methodName)
Write trace information as a method call in the form
objectName.methodName().
|
protected void |
debugCodeCall(java.lang.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.
|
protected void |
debugCodeCall(java.lang.String methodName,
java.lang.String param)
Write trace information as a method call in the form
objectName.methodName(param) where the parameter is formatted as a Java
string.
|
protected static int |
getNextId(int type)
Get the next trace object id for this object type.
|
int |
getTraceId()
INTERNAL
|
java.lang.String |
getTraceObjectName()
INTERNAL
|
protected boolean |
isDebugEnabled()
Check if the debug trace level is enabled.
|
protected boolean |
isInfoEnabled()
Check if info trace level is enabled.
|
protected java.sql.SQLException |
logAndConvert(java.lang.Throwable ex)
Log an exception and convert it to a SQL exception if required.
|
protected static java.lang.String |
quote(java.lang.String s)
Format a string as a Java string literal.
|
protected static java.lang.String |
quoteArray(java.lang.String[] s)
Format a string array to the Java source code that represents this
object.
|
protected static java.lang.String |
quoteBigDecimal(java.math.BigDecimal x)
Format a big decimal to the Java source code that represents this object.
|
protected static java.lang.String |
quoteBytes(byte[] x)
Format a byte array to the Java source code that represents this object.
|
protected static java.lang.String |
quoteDate(java.sql.Date x)
Format a date to the Java source code that represents this object.
|
protected static java.lang.String |
quoteIntArray(int[] s)
Format an int array to the Java source code that represents this object.
|
protected static java.lang.String |
quoteMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
Format a map to the Java source code that represents this object.
|
protected static java.lang.String |
quoteTime(java.sql.Time x)
Format a time to the Java source code that represents this object.
|
protected static java.lang.String |
quoteTimestamp(java.sql.Timestamp x)
Format a timestamp to the Java source code that represents this object.
|
protected void |
setTrace(Trace trace,
int type,
int id)
Set the options to use when writing trace message.
|
protected java.sql.SQLException |
unsupported(java.lang.String message)
Get a SQL exception meaning this feature is not supported.
|
protected static final int CALLABLE_STATEMENT
protected static final int CONNECTION
protected static final int DATABASE_META_DATA
protected static final int PREPARED_STATEMENT
protected static final int RESULT_SET
protected static final int RESULT_SET_META_DATA
protected static final int SAVEPOINT
protected static final int STATEMENT
protected static final int BLOB
protected static final int CLOB
protected static final int PARAMETER_META_DATA
protected static final int DATA_SOURCE
protected static final int XA_DATA_SOURCE
protected static final int XID
protected static final int ARRAY
protected Trace trace
protected void setTrace(Trace trace, int type, int id)
trace - the trace objecttype - the trace object typeid - the trace object idpublic int getTraceId()
public java.lang.String getTraceObjectName()
protected static int getNextId(int type)
type - the object typeprotected boolean isDebugEnabled()
protected boolean isInfoEnabled()
protected void debugCodeAssign(java.lang.String className,
int newType,
int newId,
java.lang.String value)
className - the class name of the resultnewType - the prefix typenewId - the trace object id of the created objectvalue - the value to assign this new object toprotected void debugCodeCall(java.lang.String methodName)
methodName - the method nameprotected void debugCodeCall(java.lang.String methodName,
long param)
methodName - the method nameparam - one single long parameterprotected void debugCodeCall(java.lang.String methodName,
java.lang.String param)
methodName - the method nameparam - one single string parameterprotected void debugCode(java.lang.String text)
text - the trace textprotected static java.lang.String quote(java.lang.String s)
s - the string to convertprotected static java.lang.String quoteTime(java.sql.Time x)
x - the time to convertprotected static java.lang.String quoteTimestamp(java.sql.Timestamp x)
x - the timestamp to convertprotected static java.lang.String quoteDate(java.sql.Date x)
x - the date to convertprotected static java.lang.String quoteBigDecimal(java.math.BigDecimal x)
x - the big decimal to convertprotected static java.lang.String quoteBytes(byte[] x)
x - the byte array to convertprotected static java.lang.String quoteArray(java.lang.String[] s)
s - the string array to convertprotected static java.lang.String quoteIntArray(int[] s)
s - the int array to convertprotected static java.lang.String quoteMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
map - the map to convertprotected java.sql.SQLException logAndConvert(java.lang.Throwable ex)
ex - the exceptionprotected java.sql.SQLException unsupported(java.lang.String message)
message - the message