Package oracle.jdbc
Interface TraceEventListener.TraceContext
-
- Enclosing interface:
- TraceEventListener
public static interface TraceEventListener.TraceContextInformation about the round trip. Valid only for the duration of the call toTraceEventListener.roundTrip(Sequence, TraceContext, Object). Provides limited ability to set state for the duration of the round trip.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringactualSqlText()Return the SQL text the driver is sending to the database, if any.java.lang.StringdatabaseOperation()Returns a short String describing the purpose of the round trip, eg "FETCH ROWS", "EXECUTE SQL".java.lang.StringgetClientInfo(java.lang.String name)Get a single client info value.java.lang.StringgetConnectionId()Returns the Connection id.java.lang.StringgetSqlId()Returns the SQL ID of the executing Statement.java.lang.BooleanisCompletedExceptionally()Returns true if this round trip completed exceptionally, in any way.java.lang.StringoriginalSqlText()Returns the original SQL text the user code passed to the driver, if any.voidsetClientInfo(java.lang.String name, java.lang.String value)Set the client info name, value pairs.java.lang.Stringtenant()Return the current tenant (PDB) ID.java.lang.Stringuser()Return the current user ID.
-
-
-
Method Detail
-
getConnectionId
java.lang.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
java.lang.String databaseOperation()
Returns a short String describing the purpose of the round trip, eg "FETCH ROWS", "EXECUTE SQL".- Returns:
- a short description of the purpose of the round trip. Not
null. - Throws:
java.lang.IllegalStateException- if the call toTraceEventListener.roundTrip(Sequence, TraceContext, Object)has ended.
-
originalSqlText
java.lang.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
java.lang.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
java.lang.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
java.lang.String tenant()
Return the current tenant (PDB) ID.- Returns:
- the current tenant ID. May be
null.
-
getSqlId
java.lang.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
java.lang.Boolean isCompletedExceptionally()
Returns true if this round trip completed exceptionally, in any way.- Returns:
- the round trip completion status.
-
setClientInfo
void setClientInfo(java.lang.String name, java.lang.String value) throws java.sql.SQLClientInfoExceptionSet 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:
java.sql.SQLClientInfoException- if a name is of the wrong form or if the namespace is not supported
-
getClientInfo
java.lang.String getClientInfo(java.lang.String name) throws java.sql.SQLExceptionGet 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:
java.sql.SQLException- if the connection is closed
-
-