- 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 转化HashMap
最新推荐文章于 2024-04-24 22:37:12 发布