public ResultSet runSelect(String query_key, Object... params) { return runSelect(false, query_key, params); }
public ResultSet runSelect(String query_key, Object... params) { return runSelect(false, query_key, params); }
public static Map<String, String> select_map(DbConn cnx, String query_key, Object... args) { Map<String, String> res = new HashMap<String, String>(); try { ResultSet rs = cnx.runSelect(query_key, args); while (rs.next()) { res.put(rs.getString(2), rs.getString(3)); } } catch (SQLException e) { throw new DatabaseException(e); } return res; }
public static Map<String, String> select_map(DbConn cnx, String query_key, Object... args) { Map<String, String> res = new HashMap<String, String>(); try { ResultSet rs = cnx.runSelect(query_key, args); while (rs.next()) { res.put(rs.getString(3), rs.getString(4)); } } catch (SQLException e) { throw new DatabaseException(e); } return res; }
public static Map<String, String> select_map(DbConn cnx, String query_key, Object... args) { Map<String, String> res = new HashMap<>(); try { ResultSet rs = cnx.runSelect(query_key, args); while (rs.next()) { res.put(rs.getString(3), rs.getString(4)); } } catch (SQLException e) { throw new DatabaseException(e); } return res; }
public static Map<String, String> select_map(DbConn cnx, String query_key, Object... args) { Map<String, String> res = new HashMap<>(); try { ResultSet rs = cnx.runSelect(query_key, args); while (rs.next()) { res.put(rs.getString(2), rs.getString(3)); } } catch (SQLException e) { throw new DatabaseException(e); } return res; }
public static List<Node> select(DbConn cnx, String query_key, Object... args) { List<Node> res = new ArrayList<Node>(); try { ResultSet rs = cnx.runSelect(query_key, args); while (rs.next()) { res.add(map(cnx, rs, 0)); } } catch (SQLException e) { throw new DatabaseException(e); } return res; }
public static List<GlobalParameterDto> getGlobalParameter(DbConn cnx) { ResultSet rs = cnx.runSelect("globalprm_select_all"); List<GlobalParameterDto> res = new ArrayList<GlobalParameterDto>(); try { while (rs.next()) { res.add(mapGlobalParameter(rs)); } rs.close(); } catch (SQLException e) { throw new JqmAdminApiInternalException("An error occurred while querying the database", e); } return res; }
public static List<NodeDto> getNodes(DbConn cnx) { List<NodeDto> res = new ArrayList<NodeDto>(); try { ResultSet rs = cnx.runSelect("node_select_all"); while (rs.next()) { res.add(mapNode(rs, 0)); } rs.close(); } catch (SQLException e) { throw new DatabaseException(e); } return res; }
public static List<QueueMappingDto> getNodeQueueMappings(DbConn cnx, int nodeId) { ResultSet rs = null; List<QueueMappingDto> res = new ArrayList<QueueMappingDto>(); try { rs = cnx.runSelect("dp_select_with_names_by_node_id", nodeId); while (rs.next()) { res.add(mapQueueMapping(rs, 0)); } rs.close(); } catch (SQLException e) { throw new DatabaseException(e); } return res; }
public static List<QueueDto> getQueues(DbConn cnx) { List<QueueDto> res = new ArrayList<QueueDto>(); try { ResultSet rs = cnx.runSelect("q_select_all"); while (rs.next()) { res.add(mapQueue(rs, 0)); } rs.close(); } catch (SQLException e) { throw new DatabaseException(e); } return res; }
public static List<Node> select(DbConn cnx, String query_key, Object... args) { List<Node> res = new ArrayList<>(); try { ResultSet rs = cnx.runSelect(query_key, args); while (rs.next()) { res.add(map(cnx, rs, 0)); } } catch (SQLException e) { throw new DatabaseException(e); } return res; }
public static List<Queue> select(DbConn cnx, String query_key, Object... args) { List<Queue> res = new ArrayList<Queue>(); try { ResultSet rs = cnx.runSelect(query_key, args); while (rs.next()) { Queue tmp = map(rs, 0); res.add(tmp); } } catch (SQLException e) { throw new DatabaseException(e); } return res; }
public static QueueMappingDto getQueueMapping(DbConn cnx, int id) { ResultSet rs = null; try { rs = cnx.runSelect("dp_select_with_names_by_id", id); if (!rs.next()) { throw new JqmAdminApiUserException("no result"); } rs.close(); return mapQueueMapping(rs, 0); } catch (SQLException e) { throw new DatabaseException(e); } }
public static QueueMappingDto getQueueMapping(DbConn cnx, int id) { ResultSet rs = null; try { rs = cnx.runSelect("dp_select_with_names_by_id", id); if (!rs.next()) { throw new JqmAdminApiUserException("no result"); } rs.close(); return mapQueueMapping(rs, 0); } catch (SQLException e) { throw new DatabaseException(e); } }
public static NodeDto getNode(DbConn cnx, String nodeName) { ResultSet rs = null; try { rs = cnx.runSelect("node_select_by_key", nodeName); if (!rs.next()) { throw new JqmAdminApiUserException("no result"); } return mapNode(rs, 0); } catch (SQLException e) { throw new DatabaseException(e); } }
public static QueueDto getQueue(DbConn cnx, int id) { ResultSet rs = null; try { rs = cnx.runSelect("q_select_by_id", id); if (!rs.next()) { throw new JqmAdminApiUserException("no result"); } return mapQueue(rs, 0); } catch (SQLException e) { throw new DatabaseException(e); } }
public static QueueDto getQueue(DbConn cnx, int id) { ResultSet rs = null; try { rs = cnx.runSelect("q_select_by_id", id); if (!rs.next()) { throw new JqmAdminApiUserException("no result"); } return mapQueue(rs, 0); } catch (SQLException e) { throw new DatabaseException(e); } }
public static NodeDto getNode(DbConn cnx, int id) { ResultSet rs = null; try { rs = cnx.runSelect("node_select_by_id", id); if (!rs.next()) { throw new JqmAdminApiUserException("no result"); } return mapNode(rs, 0); } catch (SQLException e) { throw new DatabaseException(e); } }
public static NodeDto getNode(DbConn cnx, String nodeName) { ResultSet rs = null; try { rs = cnx.runSelect("node_select_by_key", nodeName); if (!rs.next()) { throw new JqmAdminApiUserException("no result"); } return mapNode(rs, 0); } catch (SQLException e) { throw new DatabaseException(e); } }