public List<Map<String, Object>> selectAll(String sql, Object... args) throws SQLException { PreparedStatement ps = connection.prepareStatement(sql); try { setParameters(ps, args); ResultSet rs = ps.executeQuery(); return getResults(rs); } finally { try { ps.close(); } catch (SQLException e) { //ignore } } }
/** * Executes a SELECT statement that returns multiple rows. * * @param sql The SQL * @param args The arguments to be set on the statement. * @return The list of rows expected. * @throws SQLException If statement preparation or execution fails */ public List<Map<String, Object>> selectAll(String sql, Object... args) throws SQLException { PreparedStatement ps = connection.prepareStatement(sql); try { setParameters(ps, args); ResultSet rs = ps.executeQuery(); return getResults(rs); } finally { try { ps.close(); } catch (SQLException e) { //ignore } } }
ps.executeUpdate(); if (useGeneratedKeySupport) { List<Map<String, Object>> keys = getResults(ps.getGeneratedKeys()); if (keys.size() == 1) { Map<String, Object> key = keys.get(0);
ps.executeUpdate(); if (useGeneratedKeySupport) { List<Map<String, Object>> keys = getResults(ps.getGeneratedKeys()); if (keys.size() == 1) { Map<String, Object> key = keys.get(0);
/** * Executes a SELECT statement that returns multiple rows. * * @param sql The SQL * @param args The arguments to be set on the statement. * @return The number of rows impacted or BATCHED_RESULTS if the statements are being batched. * @throws SQLException If statement prepration or execution fails */ public List<Map<String, Object>> selectAll(String sql, Object... args) throws SQLException { PreparedStatement ps = connection.prepareStatement(sql); try { setParameters(ps, args); ResultSet rs = ps.executeQuery(); return getResults(rs); } finally { try { ps.close(); } catch (SQLException e) { //ignore } } }
ps.executeUpdate(); if (useGeneratedKeySupport) { List<Map<String, Object>> keys = getResults(ps.getGeneratedKeys()); if (keys.size() == 1) { Map<String, Object> key = keys.get(0);