public int getMailBytes(String username, Manager.MailRole role, int n) {
        if (n == 0) {
            String sql = "SELECT Sum(bytes) FROM mail_info " + "WHERE role=" 
                    + role.ordinal() + " and username='" + username + "';";
            
            logger.debug(sql);
            
            try {
                ResultSet rs = stmt.executeQuery(sql);
                if (rs.next()) {
                    int cnt = rs.getInt(1);
                    return cnt;
                }
                else
                    return 0;
            }
            catch (Exception e) {
                logger.error(e);
                return 0;
            }
        }
        else {
            String sql = "SELECT bytes FROM mail_info " + 
                    "WHERE role=1 and username='" +username + "';";
            
            logger.debug(sql);
            
            try {
                ResultSet rs = stmt.executeQuery(sql);
                while (rs.next()) {
                    if (rs.getRow() == n)
                    {
                        int cnt = rs.getInt("bytes");
                        return cnt;
                    }
                }
                return 0;
            }
            catch (Exception e) {
                logger.error(e);
                return 0;
            }
        }
    }