如果我想使用 hashmap 从 oracle 表中读取数据,那么我可以像这样读取它............
String sql = "select * from DPY_VW_REP_DELIVERY_DTLS where weighed_date between ? and ?";
Object[] queryParams = new Object[] {dateFrom, dateTo};
List rsList = this.getJdbcTemplate().queryForList(sql, queryParams);
Iterator it = rsList.iterator();
while(it.hasNext())
{
try
{
LinkedHashMap map = (LinkedHashMap) it.next();
String[] strData = new String[14];
strData[0] = map.get("WEIGHED_DATE_AS_CHAR").toString();
strData[1] = map.get("WEIGHED_DAY_SLNO").toString();
strData[2] = map.get("PARTY_NAME").toString();
strData[3] = map.get("PARTY_ADDRESS1").toString();
strData[4] = map.get("PARTY_ADDRESS2").toString();
strData[5] = map.get("VEHICLE_NO").toString();
}
}
但是如果我想使用 hashmap 读取包含相同数据的 xls 文件,我该怎么做......