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<GlobalParameterDto> getGlobalParameter(DbConn cnx) { ResultSet rs = cnx.runSelect("globalprm_select_all"); List<GlobalParameterDto> res = new ArrayList<>(); 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; }
private static RRoleDto mapRole(ResultSet rs, int colShift) { try { RRoleDto tmp = new RRoleDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setName(rs.getString(2 + colShift)); tmp.setDescription(rs.getString(3 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
private static RRoleDto mapRole(ResultSet rs, int colShift) { try { RRoleDto tmp = new RRoleDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setName(rs.getString(2 + colShift)); tmp.setDescription(rs.getString(3 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
private static QueueDto mapQueue(ResultSet rs, int colShift) { try { QueueDto tmp = new QueueDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setDefaultQueue(rs.getBoolean(2 + colShift)); tmp.setDescription(rs.getString(3 + colShift)); tmp.setName(rs.getString(4 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
private static QueueDto mapQueue(ResultSet rs, int colShift) { try { QueueDto tmp = new QueueDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setDefaultQueue(rs.getBoolean(2 + colShift)); tmp.setDescription(rs.getString(3 + colShift)); tmp.setName(rs.getString(4 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
private static GlobalParameterDto getGlobalParameter(DbConn cnx, String query_key, Object key) { ResultSet rs = cnx.runSelect(query_key, key); try { if (!rs.next()) { throw new NoResultException("The query returned zero rows when one was expected."); } GlobalParameterDto res = mapGlobalParameter(rs); if (rs.next()) { throw new NonUniqueResultException("The query returned more than one row when one was expected"); } rs.close(); return res; } catch (SQLException e) { throw new JqmAdminApiInternalException("An error occurred while querying the database", e); } }
throw new JqmAdminApiInternalException("An error occurred while querying the database", e);
throw new JqmAdminApiInternalException("An error occurred while querying the database", e);
private static GlobalParameterDto getGlobalParameter(DbConn cnx, String query_key, Object key) { ResultSet rs = cnx.runSelect(query_key, key); try { if (!rs.next()) { throw new NoResultException("The query returned zero rows when one was expected."); } GlobalParameterDto res = mapGlobalParameter(rs); if (rs.next()) { throw new NonUniqueResultException("The query returned more than one row when one was expected"); } rs.close(); return res; } catch (SQLException e) { throw new JqmAdminApiInternalException("An error occurred while querying the database", e); } }
private static QueueMappingDto mapQueueMapping(ResultSet rs, int colShift) { try { QueueMappingDto tmp = new QueueMappingDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setEnabled(rs.getBoolean(2 + colShift)); tmp.setNbThread(rs.getInt(4 + colShift)); tmp.setPollingInterval(rs.getInt(5 + colShift)); tmp.setNodeId(rs.getInt(6 + colShift)); tmp.setQueueId(rs.getInt(7 + colShift)); tmp.setNodeName(rs.getString(8 + colShift)); tmp.setQueueName(rs.getString(9 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
private static QueueMappingDto mapQueueMapping(ResultSet rs, int colShift) { try { QueueMappingDto tmp = new QueueMappingDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setEnabled(rs.getBoolean(2 + colShift)); tmp.setNbThread(rs.getInt(4 + colShift)); tmp.setPollingInterval(rs.getInt(5 + colShift)); tmp.setNodeId(rs.getInt(6 + colShift)); tmp.setQueueId(rs.getInt(7 + colShift)); tmp.setNodeName(rs.getString(8 + colShift)); tmp.setQueueName(rs.getString(9 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
throw new JqmAdminApiInternalException(e);
private static RUserDto mapUser(ResultSet rs, int colShift, DbConn cnx) { try { RUserDto tmp = new RUserDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setLogin(rs.getString(2 + colShift)); tmp.setLocked(rs.getBoolean(5 + colShift)); tmp.setExpirationDate(cnx.getCal(rs, 6 + colShift)); tmp.setCreationDate(cnx.getCal(rs, 7 + colShift)); tmp.setEmail(rs.getString(9 + colShift)); tmp.setFreeText(rs.getString(10 + colShift)); tmp.setInternal(rs.getBoolean(11 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
private static RUserDto mapUser(ResultSet rs, int colShift, DbConn cnx) { try { RUserDto tmp = new RUserDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setLogin(rs.getString(2 + colShift)); tmp.setLocked(rs.getBoolean(5 + colShift)); tmp.setExpirationDate(cnx.getCal(rs, 6 + colShift)); tmp.setCreationDate(cnx.getCal(rs, 7 + colShift)); tmp.setEmail(rs.getString(9 + colShift)); tmp.setFreeText(rs.getString(10 + colShift)); tmp.setInternal(rs.getBoolean(11 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
throw new JqmAdminApiInternalException(e); throw new JqmAdminApiInternalException(e);
throw new JqmAdminApiInternalException(e); throw new JqmAdminApiInternalException(e);
throw new JqmAdminApiInternalException(e);