1 18 19 package org.apache.beehive.controls.system.jdbc; 20 21 import org.apache.beehive.controls.api.ControlException; 22 23 import java.sql.ResultSet ; 24 import java.sql.SQLException ; 25 import java.util.Calendar ; 26 27 30 public final class RowToHashMapMapper extends RowMapper { 31 32 private final String [] _keys; 33 34 35 41 RowToHashMapMapper(ResultSet resultSet, Class returnTypeClass, Calendar cal) { 42 super(resultSet, returnTypeClass, cal); 43 try { 44 _keys = getKeysFromResultSet(); 45 } catch (SQLException sql) { 46 throw new ControlException("RowToHashMapMapper: SQLException: " + sql.getMessage(), sql); 47 } 48 } 49 50 55 public Object mapRowToReturnType() { 56 try { 57 return new ResultSetHashMap(_resultSet, _keys); 58 } catch (SQLException e) { 59 throw new ControlException("Exception creating HashMap return type: ", e); 60 } 61 } 62 } 63 | Popular Tags |