将查询结果输入list中并输出
借用ResultSetMetaData
ArrayList list = new ArrayList();
ResultSetMetaData md = resultSet.getMetaData();
int columnCount = md.getColumnCount();
while(resultSet.next()){
Map rowData = new HashMap();
for(int i=1;i<=columnCount;i++){
rowData.put(md.getColumnName(i),resultSet.getObject(i));
}
list.add(rowData);
}