Package org.apache.openjpa.lib.jdbc
Class JDBCEvent
java.lang.Object
java.util.EventObject
org.apache.openjpa.lib.jdbc.JDBCEvent
- All Implemented Interfaces:
Serializable
A JDBC event. The event source will be the connection.
- Author:
- Marc Prud'hommeaux, Abe White
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final short
Type code indicating that aConnection
was just committed.static final short
Type code indicating that a connection was obtained.static final short
Type code indicating that aStatement
is being created.static final short
Type code indicating that aStatement
completed execution.static final short
Type code indicating that aStatement
is being prepared.static final short
Type code indicating that a rollback just occured.static final short
Type code indicating that a connection was closed.static final short
Type code indicating that aConnection
is about to be committed.static final short
Type code indicating that aStatement
is being created.static final short
Type code indicating that aStatement
is about to be executed.static final short
Type code indicating that aStatement
is being prepared.static final short
Type code indicating that a rollback is about to occur.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionJDBCEvent
(Connection source, short type, JDBCEvent associatedEvent, Statement statement, String sql) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal JDBCEvent
Return the associatedJDBCEvent
for this event.final Connection
Return the Connection for this event.final String
getSQL()
Return the SQL associated with this event; may be null.final Statement
Return the Statement for this event, may be null for events unrelated to Statement execution.final long
getTime()
Return the time the event was constructed.final short
getType()
Return the event's type code.Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
BEFORE_PREPARE_STATEMENT
public static final short BEFORE_PREPARE_STATEMENTType code indicating that aStatement
is being prepared.- See Also:
-
AFTER_PREPARE_STATEMENT
public static final short AFTER_PREPARE_STATEMENTType code indicating that aStatement
is being prepared.- See Also:
-
BEFORE_CREATE_STATEMENT
public static final short BEFORE_CREATE_STATEMENTType code indicating that aStatement
is being created.- See Also:
-
AFTER_CREATE_STATEMENT
public static final short AFTER_CREATE_STATEMENTType code indicating that aStatement
is being created.- See Also:
-
BEFORE_EXECUTE_STATEMENT
public static final short BEFORE_EXECUTE_STATEMENTType code indicating that aStatement
is about to be executed.- See Also:
-
AFTER_EXECUTE_STATEMENT
public static final short AFTER_EXECUTE_STATEMENTType code indicating that aStatement
completed execution.- See Also:
-
BEFORE_COMMIT
public static final short BEFORE_COMMITType code indicating that aConnection
is about to be committed.- See Also:
-
AFTER_COMMIT
public static final short AFTER_COMMITType code indicating that aConnection
was just committed.- See Also:
-
BEFORE_ROLLBACK
public static final short BEFORE_ROLLBACKType code indicating that a rollback is about to occur.- See Also:
-
AFTER_ROLLBACK
public static final short AFTER_ROLLBACKType code indicating that a rollback just occured.- See Also:
-
AFTER_CONNECT
public static final short AFTER_CONNECTType code indicating that a connection was obtained. This does not necessarily mean that the connection is new if pooling is enabled.- See Also:
-
BEFORE_CLOSE
public static final short BEFORE_CLOSEType code indicating that a connection was closed. This does not necessarily mean that the underlying database connection was severed if pooling is enabled.- See Also:
-
-
Constructor Details
-
JDBCEvent
public JDBCEvent(Connection source, short type, JDBCEvent associatedEvent, Statement statement, String sql) Constructor.
-
-
Method Details
-
getType
public final short getType()Return the event's type code. -
getConnection
Return the Connection for this event. -
getTime
public final long getTime()Return the time the event was constructed. -
getAssociatedEvent
Return the associatedJDBCEvent
for this event. For AFTER_XXX events, this will typically be the JDBCEvent that was created in the BEFORE_XXX stage. This may be null when an association is not appropriate for the event. -
getSQL
Return the SQL associated with this event; may be null. -
getStatement
Return the Statement for this event, may be null for events unrelated to Statement execution.
-