| 287 | } |
| 288 | |
| 289 | public static List<Object[]> toList(ResultSet rs) throws SQLException { |
| 290 | ResultSetMetaData rs_md = rs.getMetaData(); |
| 291 | int num_cols = rs_md.getColumnCount(); |
| 292 | |
| 293 | List<Object[]> results = new ArrayList<>(); |
| 294 | while (rs.next()) { |
| 295 | Object[] row = new Object[num_cols]; |
| 296 | for (int i = 0; i < num_cols; i++) { |
| 297 | row[i] = rs.getObject(i + 1); |
| 298 | } |
| 299 | results.add(row); |
| 300 | } |
| 301 | |
| 302 | return results; |
| 303 | } |
| 304 | |
| 305 | /** |
| 306 | * For the given string representation of a value, convert it to the proper object based on its |