这个感觉不是很好:然后改成下面的这种方式:
public static List> convertList(ResultSet rs) {
List> list = new ArrayList>();
try {
ResultSetMetaData md = rs.getMetaData();
int columnCount = md.getColumnCount();
while (rs.next()) {
Map rowData = new HashMap();
for (int i = 1; i <= columnCount; i++) {
rowData.put(md.getColumnName(i), rs.getObject(i));
}
list.add(rowData);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
if (rs != null)
rs.close();
rs = null;
} catch (SQLException e) {
e.printStackTrace();
}
}
return list;
}
public static Map convertMap(Resul