1 22 23 24 package com.mchange.v2.c3p0.impl; 25 26 import java.sql.*; 27 import java.util.Set ; 28 import com.mchange.v2.sql.filter.FilterResultSet; 29 30 abstract class SetManagedResultSet extends FilterResultSet 31 { 32 Set activeResultSets; 33 34 SetManagedResultSet(Set activeResultSets) 35 { 36 this.activeResultSets = activeResultSets; 37 } 38 39 SetManagedResultSet(ResultSet inner, Set activeResultSets) 40 { 41 super( inner ); 42 this.activeResultSets = activeResultSets; 43 } 44 45 public synchronized void setInner(ResultSet inner) 46 { 47 this.inner = inner; 48 activeResultSets.add( inner ); 49 } 50 51 public synchronized void close() throws SQLException 52 { 53 if ( inner != null ) 54 { 55 inner.close(); 56 activeResultSets.remove( inner ); 57 inner = null; 58 } 59 } 60 } 61 | Popular Tags |