1 61 62 package org.apache.commons.dbutils.handlers; 63 64 import java.sql.ResultSet ; 65 import java.sql.SQLException ; 66 67 import org.apache.commons.dbutils.BasicRowProcessor; 68 import org.apache.commons.dbutils.ResultSetHandler; 69 import org.apache.commons.dbutils.RowProcessor; 70 71 81 public class BeanListHandler implements ResultSetHandler { 82 83 86 private Class type = null; 87 88 92 private RowProcessor convert = BasicRowProcessor.instance(); 93 94 100 public BeanListHandler(Class type) { 101 this.type = type; 102 } 103 104 112 public BeanListHandler(Class type, RowProcessor convert) { 113 this.type = type; 114 this.convert = convert; 115 } 116 117 127 public Object handle(ResultSet rs) throws SQLException { 128 return this.convert.toBeanList(rs, type); 129 } 130 131 } 132 | Popular Tags |