Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static final String LOAD_QUEUE =
- "SELECT name, description, priority, maxchats, minchats, overflow, backupQueue FROM " +
- "fpQueue WHERE queueID=?";
- private void loadQueue() {
- Connection con = null;
- PreparedStatement pstmt = null;
- ResultSet rs = null;
- try {
- con = DbConnectionManager.getConnection();
- pstmt = con.prepareStatement(LOAD_QUEUE);
- pstmt.setLong(1, id);
- rs = pstmt.executeQuery();
- rs.next();
- name = rs.getString(1);
- address = new JID(workgroup.getJID().getNode(), workgroup.getJID().getDomain(), name);
- description = rs.getString(2);
- priority = rs.getInt(3);
- maxChats = rs.getInt(4);
- minChats = rs.getInt(5);
- switch (rs.getInt(6)) {
- case 1:
- overflowType = OverflowType.OVERFLOW_RANDOM;
- break;
- case 2:
- overflowType = OverflowType.OVERFLOW_BACKUP;
- break;
- default:
- overflowType = OverflowType.OVERFLOW_NONE;
- }
- backupQueueID = rs.getLong(7);
- }
- catch (SQLException e) {
- Log.error(e.getMessage(), e);
- }
- finally {
- DbConnectionManager.closeConnection(rs, pstmt, con);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement