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.Connection;
14: import java.sql.Statement;
15:
16: /**
17: * A JDBC Connection related event (open, close etc.).
18: */
19: public class JdbcConnectionEvent extends JdbcLogEvent {
20:
21: private int connectionID;
22: private int statementID;
23: private int resultSetType;
24: private int resultSetConcurrency;
25:
26: public JdbcConnectionEvent(long txId, Connection con, String descr,
27: int type) {
28: super (txId, type, descr);
29: this .connectionID = System.identityHashCode(con);
30: }
31:
32: public int getConnectionID() {
33: return connectionID;
34: }
35:
36: public void updateConnectionID(Connection con) {
37: connectionID = System.identityHashCode(con);
38: }
39:
40: public int getStatementID() {
41: return statementID;
42: }
43:
44: public void updateStatementID(Statement stat) {
45: statementID = System.identityHashCode(stat);
46: }
47:
48: public int getResultSetType() {
49: return resultSetType;
50: }
51:
52: public void setResultSetType(int resultSetType) {
53: this .resultSetType = resultSetType;
54: }
55:
56: public int getResultSetConcurrency() {
57: return resultSetConcurrency;
58: }
59:
60: public void setResultSetConcurrency(int resultSetConcurrency) {
61: this .resultSetConcurrency = resultSetConcurrency;
62: }
63:
64: public boolean isScrollable() {
65: return resultSetType != 0;
66: }
67:
68: }
|