import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.apache.commons.dbutils.BasicRowProcessor;
import org.apache.commons.dbutils.handlers.MapListHandler;
public class DbUtils {
@SuppressWarnings("unchecked")
public static List<Map<String, Object>> resultSetToMapList(ResultSet rs) throws SQLException {
BasicRowProcessor convert = new BasicRowProcessor();
MapListHandler handler = new MapListHandler(convert);
return (List<Map<String, Object>>) handler.handle(rs);
}
}