Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static final String LOAD_WORKGROUP =
- "SELECT jid, displayName, description, status, modes, creationDate, " +
- "modificationDate, maxchats, minchats, offerTimeout, requestTimeout, " +
- "schedule FROM fpWorkgroup WHERE workgroupID=?";
- private void loadWorkgroup() {
- Connection con = null;
- PreparedStatement pstmt = null;
- ResultSet rs = null;
- try {
- con = DbConnectionManager.getConnection();
- pstmt = con.prepareStatement(LOAD_WORKGROUP);
- pstmt.setLong(1, id);
- rs = pstmt.executeQuery();
- if (rs.next()) {
- workgroupName = rs.getString(1);
- if (rs.getString(2) != null && rs.getString(2).length() > 0) {
- displayName = rs.getString(2);
- }
- else {
- displayName = workgroupName;
- }
- description = rs.getString(3);
- open = rs.getInt(4) == 1;
- followSchedule = rs.getInt(5) == 1;
- creationDate = new Date(Long.parseLong(rs.getString(6).trim()));
- modDate = new Date(Long.parseLong(rs.getString(7).trim()));
- maxChats = rs.getInt(8);
- minChats = rs.getInt(9);
- offerTimeout = rs.getInt(10);
- requestTimeout = rs.getInt(11);
- schedule = new Schedule(id, rs.getString(12));
- }
- }
- catch (SQLException ex) {
- Log.error(ex.getMessage(), ex);
- }
- finally {
- DbConnectionManager.closeConnection(rs, pstmt, con);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement