这只是a_horse_with_no_name答案的一种变体。在这里,我们使用此处建议
List的
List对象。
final ResultSetmetaData meta = rs.getmetaData();final int columnCount = meta.getColumnCount();final List<List<String>> rowList = new linkedList<List<String>>();while (rs.next()){ final List<String> columnList = new linkedList<String>(); rowList.add(columnList); for (final int column = 1; column <= columnCount; ++column) { final Object value = rs.getObject(column); columnList.add(String.valueOf(value)); }}// add the rowList to the request.编辑将 final添加到所有变量。



