Package model

Examples of model.Sportif


            System.out.println(query);
            List<Sportif> ListeDesSportifs = new ArrayList<Sportif>();
            ResultSet rs = stmt.executeQuery(query);
            while (rs.next()) {

                ListeDesSportifs.add(new Sportif(rs.getInt(1),
                        rs.getString(2), rs.getString(3), rs.getDate(4), rs.getString(5), rs.getDate(6),
                        rs.getString(7), rs.getInt(8), rs.getString(9)));
            }
            rs.close();
            stmt.close();
View Full Code Here


            System.out.println(query);
            ResultSet rs = stmt.executeQuery(query);
            List<Sportif> listedesPays = new ArrayList<Sportif>();
            listedesPays.clear(); // efface tous les éléments de la liste sportifs
            while (rs.next()) {
                listedesPays.add(new Sportif(rs.getString(1)));
            }
            rs.close();
            stmt.close();
            return listedesPays;
        } catch (SQLException ex) {
View Full Code Here

    public Sportif loadSportif(int idSportif) throws DAOException {
               Connection con = null;
        Statement stmt = null;
        ResultSet rs = null;

        Sportif s = null;

        try {
            synchronized (dataSource) {
                con = dataSource.getConnection();
            }
            stmt = con.createStatement();
            String query = "SELECT * FROM LESSPORTIFS WHERE IDSP = " + idSportif;
            System.out.println(query);
            rs = stmt.executeQuery(query);

            while (rs.next()) {

                s = new Sportif(rs.getInt(1),
                        rs.getString(2), rs.getString(3), rs.getDate(4), rs.getString(5), rs.getDate(6),
                        rs.getString(7), rs.getInt(8), rs.getString(9));
            }
            rs.close();
            stmt.close();
View Full Code Here

        Date DateInsc = null;
        String nomp = "nomP";
        String nomBat = "nomBat";
        String numLog = "nomLog";

        Sportif sp = new Sportif();
        //SportifDAO conP = new SportifDAO();

        SportifDAO Spdao = new SportifDAO(dataSource);

        try {
            //      SportifDAO sportifDAO = SportifDAO.getInstance(dataSource);
            // IdSP = Integer.parseInt(request.getParameter(arg0));
            sp.setNomSportif(request.getParameter(nomSp));
            sp.setPrenomSportif(request.getParameter(prenomSp));
            //  sp.setDateNaissance(request.getParameter(DateNais));
            sp.setSexeSportif(request.getParameter(sexe));
            //sp.setDateInscription(request.getParameter(DateInsc));
            sp.setNomPays(request.getParameter(nomp));

            sp.setNumLogement(Integer.parseInt(request.getParameter(numLog)));
            sp.setNomBatiment(request.getParameter(nomBat));
            //sp.setNumLogement(1);

            Spdao.enregistrement(sp);

View Full Code Here

            stmt = conn.createStatement();
            System.out.println(req);
            result = stmt.executeQuery(req);

            while (result.next()) {
                sportifs.add(new Sportif(result.getInt(1), result.getString(2), result.getString(3), result.getString(4)));
           }
            result.close();
            stmt.close();
            return sportifs;
        } catch (SQLException ex) {
View Full Code Here

            stmt = conn.createStatement();
            System.out.println(req);
            result = stmt.executeQuery(req);

            while (result.next()) {
                sportifsEq.add(new Sportif(result.getInt(2), result.getString(3), result.getString(4), result.getString(5)));
                }
            result.close();
            stmt.close();
            return sportifsEq;
        } catch (SQLException ex) {
View Full Code Here

    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        try {
            int idSportif = Integer.parseInt(request.getParameter("idsportif"));
            SportifDAO spdao = new SportifDAO(dataSource);
            Sportif s = spdao.loadSportif(idSportif);
            request.setAttribute("sportif", s);
            getServletContext().getRequestDispatcher("/formulaireSupprimerSportif.jsp").forward(request, response);
            return;
        } catch (Exception e) {
            throw new ServletException(e.getMessage(), e);
View Full Code Here

        String nomp = "nomP";
        String nomBat = "nombat";
        String numLog = "numLog";
        String IDSP = "Identif";
        // int IDSP = 0;
        Sportif sp = new Sportif();
        //SportifDAO conP = new SportifDAO();

        SportifDAO Spdao = new SportifDAO(dataSource);

        try {
            //      SportifDAO sportifDAO = SportifDAO.getInstance(dataSource);

            //    IDSP = getIntParameter(request, "noEtud", "Numéro de sportif incorrect");
            //IDSP = Integer.parseInt(request.getParameter(idsp));

            sp.setNomSportif(request.getParameter(nomSp));
            sp.setPrenomSportif(request.getParameter(prenomSp));
//      sp.setDateNaissance(request.getParameter(DateNais));
            sp.setSexeSportif(request.getParameter(sexe));
//          //sp.setDateInscription(request.getParameter(DateInsc));
            sp.setNomPays(request.getParameter(nomp));
            sp.setNomBatiment(request.getParameter(nomBat));
            sp.setNumLogement(Integer.parseInt(request.getParameter(numLog)));
//      //sp.setNumLogement(1);
           
           
            //transformer les carateres de l'identifiant en int
            int idsp = Integer.parseInt(request.getParameter(IDSP));
            sp.setIdSportif(idsp);

            Spdao.editerSportif(sp);


            // Sportif sp = (Sportif) Session.getAttribute("Sportif");
View Full Code Here

            ResultSet rs = stmt.executeQuery(req);
            // construit la liste des sportifs inscrits
            List<Sportif> sportifs = new ArrayList<Sportif>();
            sportifs.clear(); // efface tous les éléments de la liste sportifs
            while (rs.next()) {
                sportifs.add(new Sportif(rs.getInt(1), rs.getString(2), rs.getString(3), rs.getString(4)));
            }
            rs.close();
            stmt.close();
            return sportifs;
        }
View Full Code Here

        String nomp = "nomP";
        String nomBat = "nombat";
        String numLog = "numLog";
        String IDSP = "Identif";
        // int IDSP = 0;
        Sportif sp = new Sportif();
        //SportifDAO conP = new SportifDAO();

        SportifDAO Spdao = new SportifDAO(dataSource);

        try {
            //      SportifDAO sportifDAO = SportifDAO.getInstance(dataSource);

            //    IDSP = getIntParameter(request, "noEtud", "Numéro de sportif incorrect");
            //IDSP = Integer.parseInt(request.getParameter(idsp));

            sp.setNomSportif(request.getParameter(nomSp));
            sp.setPrenomSportif(request.getParameter(prenomSp));
//      sp.setDateNaissance(request.getParameter(DateNais));
            sp.setSexeSportif(request.getParameter(sexe));
//          //sp.setDateInscription(request.getParameter(DateInsc));
            sp.setNomPays(request.getParameter(nomp));
            sp.setNomBatiment(request.getParameter(nomBat));
            sp.setNumLogement(Integer.parseInt(request.getParameter(numLog)));
//      //sp.setNumLogement(1);


            //transformer les carateres de l'identifiant en int
            int idsp = Integer.parseInt(request.getParameter(IDSP));
            sp.setIdSportif(idsp);
   Spdao.supprimerSportif(sp);


            // Sportif sp = (Sportif) Session.getAttribute("Sportif");
            // SportifDAO Spdao = new SportifDAO(dataSource);
View Full Code Here

TOP

Related Classes of model.Sportif

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.