01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.jdbc.logging;
12:
13: import java.sql.Statement;
14: import java.sql.ResultSet;
15:
16: /**
17: * A JDBC Statement, PreparedStatement or CallableStatement related event.
18: * @keep-all
19: */
20: public class JdbcStatementEvent extends JdbcLogEvent {
21:
22: private int statementID;
23: private int resultSetID;
24: private int updateCount;
25: private boolean hasResultSet;
26: private int[] updateCounts;
27:
28: public JdbcStatementEvent(long txId, Statement stat, String descr,
29: int type) {
30: super (txId, type, descr);
31: this .statementID = System.identityHashCode(stat);
32: }
33:
34: public int getStatementID() {
35: return statementID;
36: }
37:
38: public int getResultSetID() {
39: return resultSetID;
40: }
41:
42: public void updateResultSetID(ResultSet rs) {
43: resultSetID = System.identityHashCode(rs);
44: }
45:
46: public int getUpdateCount() {
47: return updateCount;
48: }
49:
50: public void setUpdateCount(int updateCount) {
51: this .updateCount = updateCount;
52: }
53:
54: public boolean isHasResultSet() {
55: return hasResultSet;
56: }
57:
58: public void setHasResultSet(boolean hasResultSet) {
59: this .hasResultSet = hasResultSet;
60: }
61:
62: public int[] getUpdateCounts() {
63: return updateCounts;
64: }
65:
66: public void setUpdateCounts(int[] updateCounts) {
67: this .updateCounts = updateCounts;
68: }
69:
70: public int getResourceID() {
71: return statementID;
72: }
73: }
|