Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static final String LOAD_AGENTS =
- "SELECT agentID FROM fpAgent";
- private void loadAgents() {
- Connection con = null;
- PreparedStatement pstmt = null;
- ResultSet rs = null;
- try {
- con = DbConnectionManager.getConnection();
- pstmt = con.prepareStatement(LOAD_AGENTS);
- rs = pstmt.executeQuery();
- while (rs.next()) {
- final Agent agent = new Agent(rs.getLong(1));
- agents.put(agent.getAgentJID().toBareJID(), agent);
- }
- }
- catch (Exception ex) {
- Log.error(ex.getMessage(), ex);
- }
- finally {
- DbConnectionManager.closeConnection(rs, pstmt, con);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement