1 16 17 18 package org.apache.commons.beanutils; 19 20 21 import java.sql.ResultSet ; 22 import java.sql.SQLException ; 23 import java.util.HashMap ; 24 import java.util.Iterator ; 25 26 27 83 84 public class ResultSetDynaClass extends JDBCDynaClass implements DynaClass { 85 86 87 89 90 102 public ResultSetDynaClass(ResultSet resultSet) throws SQLException { 103 104 this(resultSet, true); 105 106 } 107 108 109 130 public ResultSetDynaClass(ResultSet resultSet, boolean lowerCase) 131 throws SQLException { 132 133 if (resultSet == null) { 134 throw new NullPointerException (); 135 } 136 this.resultSet = resultSet; 137 this.lowerCase = lowerCase; 138 introspect(resultSet); 139 140 } 141 142 143 145 146 149 protected ResultSet resultSet = null; 150 151 152 154 155 161 public Iterator iterator() { 162 163 return (new ResultSetIterator(this)); 164 165 } 166 167 168 170 171 174 ResultSet getResultSet() { 175 176 return (this.resultSet); 177 178 } 179 180 181 183 190 protected Class loadClass(String className) throws SQLException { 191 192 try { 193 return getClass().getClassLoader().loadClass(className); 194 } 195 catch (Exception e) { 196 throw new SQLException ("Cannot load column class '" + 197 className + "': " + e); 198 } 199 } 200 } 201 | Popular Tags |