KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdbc > logging > JdbcStatementEvent


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.jdbc.logging;
13
14 import java.sql.Statement JavaDoc;
15 import java.sql.ResultSet JavaDoc;
16
17 /**
18  * A JDBC Statement, PreparedStatement or CallableStatement related event.
19  * @keep-all
20  */

21 public class JdbcStatementEvent extends JdbcLogEvent {
22
23     private int statementID;
24     private int resultSetID;
25     private int updateCount;
26     private boolean hasResultSet;
27     private int[] updateCounts;
28
29     public JdbcStatementEvent(long txId, Statement JavaDoc stat, String JavaDoc descr, 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 JavaDoc 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 }
74
75
Popular Tags