01: /*
02: * Licensed under the X license (see http://www.x.org/terms.htm)
03: */
04: package org.ofbiz.minerva.pool.jdbc;
05:
06: import java.sql.Connection;
07: import java.sql.ResultSet;
08:
09: /**
10: * Temporarily not used. Identifies a PreparedStatement by
11: * SQL, type, and concurrency.
12: *
13: * @author Aaron Mulder ammulder@alumni.princeton.edu
14: */
15: public class PSCacheKey {
16:
17: public Connection con;
18: public String sql;
19: public int rsType;
20: public int rsConcur;
21:
22: public PSCacheKey(Connection con, String sql) {
23: this .con = con;
24: this .sql = sql;
25: this .rsType = ResultSet.TYPE_FORWARD_ONLY;
26: this .rsConcur = ResultSet.CONCUR_READ_ONLY;
27: }
28:
29: public PSCacheKey(Connection con, String sql, int rsType,
30: int rsConcur) {
31: this .con = con;
32: this .sql = sql;
33: this .rsType = rsType;
34: this .rsConcur = rsConcur;
35: }
36:
37: public boolean equals(Object o) {
38: PSCacheKey key = (PSCacheKey) o;
39: return key.con.equals(con) && key.sql.equals(sql)
40: && key.rsType == rsType && key.rsConcur == rsConcur;
41: }
42:
43: public int hashCode() {
44: return con.hashCode() ^ sql.hashCode() ^ rsType ^ rsConcur;
45: }
46: }
|