1 4 package org.ofbiz.minerva.pool.jdbc; 5 6 import java.sql.Connection ; 7 import java.sql.ResultSet ; 8 9 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, int rsConcur) { 30 this.con = con; 31 this.sql = sql; 32 this.rsType = rsType; 33 this.rsConcur = rsConcur; 34 } 35 36 public boolean equals(Object o) { 37 PSCacheKey key = (PSCacheKey) o; 38 return key.con.equals(con) && key.sql.equals(sql) && key.rsType == rsType && key.rsConcur == rsConcur; 39 } 40 41 public int hashCode() { 42 return con.hashCode() ^ sql.hashCode() ^ rsType ^ rsConcur; 43 } 44 } 45 | Popular Tags |