Package oracle.jdbc
Interface TraceEventListener.TraceContext
- Enclosing interface:
- TraceEventListener
public static interface TraceEventListener.TraceContext
Information about the round trip. Valid only for the duration of the call
to
TraceEventListener.roundTrip(Sequence, TraceContext, Object).
Provides limited ability to set state for the duration of the round trip.-
Method Summary
Modifier and TypeMethodDescriptionReturn the SQL text the driver is sending to the database, if any.Returns current roundtrip database function.Returns a short String describing the purpose of the round trip, e.g.getClientInfo(String name) Get a single client info value.Returns the Connection id.getSqlId()Returns the SQL ID of the executing Statement.Returns true if this round trip completed exceptionally, in any way.Returns the original SQL text the user code passed to the driver, if any.voidsetClientInfo(String name, String value) Set the client info name, value pairs.tenant()Return the current tenant (PDB) ID.user()Return the current user ID.
-
Method Details
-
getConnectionId
String getConnectionId()Returns the Connection id. This value is unique for each physical connection across all space and time.- Returns:
- the Connection id. May be
null
-
databaseOperation
String databaseOperation()Returns a short String describing the purpose of the round trip, e.g. one of theDatabaseFunction's descriptions. This is the same as #databaseFunction().getDescription().- Returns:
- a short description of the purpose of the round trip.
- Throws:
IllegalStateException- if the call toTraceEventListener.roundTrip(Sequence, TraceContext, Object)has ended.
-
databaseFunction
DatabaseFunction databaseFunction()Returns current roundtrip database function.- Returns:
- the database function.
- Throws:
IllegalStateException- if the call toTraceEventListener.roundTrip(Sequence, TraceContext, Object)
-
originalSqlText
String originalSqlText()Returns the original SQL text the user code passed to the driver, if any.- Returns:
- the original SQL text. May be
null.
-
actualSqlText
String actualSqlText()Return the SQL text the driver is sending to the database, if any. Most likely isn't the same as the original SQL, but can be.- Returns:
- the actual SQL text. May be
null.
-
user
String user()Return the current user ID. May not be the same as the user ID used to create the connection.- Returns:
- current user ID. Not
null.
-
tenant
String tenant()Return the current tenant (PDB) ID.- Returns:
- the current tenant ID. May be
null.
-
getSqlId
String getSqlId()Returns the SQL ID of the executing Statement. SeeOracleStatement.getSqlId().- Returns:
- the SQL ID, if the executing database operation is a SQL Statement. null otherwise.
-
isCompletedExceptionally
Boolean isCompletedExceptionally()Returns true if this round trip completed exceptionally, in any way.- Returns:
- the round trip completion status.
-
setClientInfo
Set the client info name, value pairs. Names must be of the form <namespace>.<key>. Not all namespaces are supported.- Parameters:
the- set of name, value pairs. Names must be namespace, key pairs- Throws:
SQLClientInfoException- if a name is of the wrong form or if the namespace is not supported
-
getClientInfo
Get a single client info value. The name must be of the form <namespace>:<key>. Not all namespaces are supported.- Parameters:
name- namespace, key pair- Throws:
SQLException- if the connection is closed
-