Executes a SQL query as a prepared statement, setting its fields to the elements of the vararg passed. Returns a Results, which wraps a ResultSet for easier use @param query The SQL query to execute @param fields A vararg of the fields to set in the prepared statement @return The r
(String query, Object... fields)
| 390 | * @return The results of the query |
| 391 | */ |
| 392 | public Results queryResults(String query, Object... fields) { |
| 393 | try { |
| 394 | PreparedStatement statement = prepareStatement(query, fields); |
| 395 | ResultSet results = statement.executeQuery(); |
| 396 | return new Results(results, statement); |
| 397 | } catch (SQLException e) { |
| 398 | sneakyThrow(e); |
| 399 | return null; |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | /** |
| 404 | * @return The Connection this SQLHelper wraps |
no test coverage detected