KickJava   Java API By Example, From Geeks To Geeks.

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


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.Connection JavaDoc;
15 import java.sql.Statement JavaDoc;
16
17 /**
18  * A JDBC Connection related event (open, close etc.).
19  */

20 public class JdbcConnectionEvent extends JdbcLogEvent {
21
22     private int connectionID;
23     private int statementID;
24     private int resultSetType;
25     private int resultSetConcurrency;
26
27     public JdbcConnectionEvent(long txId, Connection JavaDoc con, String JavaDoc descr, 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 JavaDoc con) {
37         connectionID = System.identityHashCode(con);
38     }
39
40     public int getStatementID() {
41         return statementID;
42     }
43
44     public void updateStatementID(Statement JavaDoc 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 }
69
Popular Tags