/** * <p>forEachUserNotification</p> * * @param notifId a int. * @param rp a {@link org.opennms.netmgt.utils.RowProcessor} object. */ public void forEachUserNotification(final int notifId, final RowProcessor rp) { final Querier querier = new Querier(m_dataSource, "select * from usersNotified where notifyId = ? order by notifytime", rp); querier.execute(notifId); }
/** * <p>getServiceNames</p> * * @return a {@link java.util.List} object. */ public List<String> getServiceNames() throws SQLException { final List<String> services = new ArrayList<>(); Querier querier = new Querier(m_dataSource, "SELECT servicename FROM service", new RowProcessor() { @Override public void processRow(ResultSet rs) throws SQLException { services.add(rs.getString(1)); } }); querier.execute(new Object[] {}); return services; }
/** * <p>getActiveNodes</p> * * @return a {@link java.util.List} object. * @throws java.sql.SQLException if any. */ public List<Integer> getActiveNodes() throws SQLException { final List<Integer> allNodes = new ArrayList<>(); Querier querier = new Querier(m_dataSource, "SELECT n.nodeid FROM node n WHERE n.nodetype != 'D' ORDER BY n.nodelabel", new RowProcessor() { @Override public void processRow(ResultSet rs) throws SQLException { allNodes.add(rs.getInt(1)); } }); querier.execute(new Object[] {}); return allNodes; }
private void displayProducts() { final Querier querier = new Querier(this); ProductListAdapter productListAdapter; products = querier.getProductsListing(); if (filterBy.equals("")) productListAdapter = new ProductListAdapter(this, products.getProductsList(), byName); else { ArrayList<Product> ps = new ArrayList<>(products.getProductsList()); for (Product p : products.getProductsList()) { if (byName) { if (!p.getProductName().toLowerCase().contains(filterBy)) ps.remove(p); } else { if (!p.getOrderCode().toLowerCase().contains(filterBy)) ps.remove(p); } } Log.v("removed some junk, now there are", String.valueOf(ps.size())); productListAdapter = new ProductListAdapter(this, ps, byName); } productsLinearLayout.setAdapter(productListAdapter); }
Querier querier = new Querier(m_dataSource, "select * from events where eventid = ?", new RowProcessor() {