1 2 import org.enhydra.jdbc.pool.PoolHelper; 3 import org.enhydra.jdbc.pool.GenerationObject; 4 5 import java.sql.SQLException ; 6 7 public class SimplePoolHelper implements PoolHelper { 8 public void expire(Object o) { 9 ((Car)o).setBrand(null); 10 ((Car)o).setColor(null); 11 o = null; 12 } 13 14 public boolean checkThisObject(Object o) { 15 return o != null; 16 } 17 18 public boolean testThisObject(Object o) { 19 return (o != null) & 20 (((Car)o).getColor() != null) & 21 (((Car)o).getBrand() != null); 22 } 23 24 public GenerationObject create() throws SQLException { 25 return new GenerationObject(new Car(), 0, null, null); 26 } 27 28 public GenerationObject create(String _user, String _password) throws SQLException { 29 return new GenerationObject(new Car(), 0, _user, _password); 30 } 31 } 32 | Popular Tags |