private static Map<String, String> getResultMap(ResultSet rs)
throws SQLException {
Map<String, String> hm = new HashMap<String, String>();
ResultSetMetaData rsmd = rs.getMetaData();
int count = rsmd.getColumnCount();
for (int i = 1; i <= count; i++) {
String key = rsmd.getColumnLabel(i);
String value = rs.getString(i);
hm.put(key, value);
}
return hm;
}
将ResultSet 转换成Map
最新推荐文章于 2022-04-15 22:33:57 发布

6256

被折叠的 条评论
为什么被折叠?



