public List<Offer> listOffer(long userid, long uprofile) {

        List<Offer> list = null;
        String listOffer;
        if (uprofile == 3) {
            listOffer = "select offer_name,offer_amount,billing_cycle from trackman.defining_offer";
        } else {
            listOffer = "select offer_name,offer_amount,billing_cycle from trackman.defining_offer where assignto='" + userid + "'";
        }
        try {
            m_Connection = getDbConnection().getConnection();
            m_Statement = m_Connection.createStatement();

            m_ResultSet = m_Statement.executeQuery(listOffer);

            while (m_ResultSet.next()) {
                if (list == null) {
                    list = new ArrayList<Offer>();
                }
                Offer offer = new Offer();
                offer.setOfferName(m_ResultSet.getString(1));
                offer.setOfferAmount(m_ResultSet.getFloat(2));
                offer.setBillingCycle(m_ResultSet.getString(3));


                list.add(offer);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (m_ResultSet != null) {
                    m_ResultSet.close();
                }
                if (m_Statement != null) {
                    m_Statement.close();
                }
                if (m_Connection != null) {
                    m_Connection.close();
                }
            } catch (SQLException ex) {
                ex.printStackTrace();

            }
        }
        return list;

    }