Package beans

Examples of beans.GameInfo


     
    Statement stmt = con.createStatement();
   
    ResultSet rs = stmt.executeQuery("select nom,description,controls,numberofplay,numberofrates,rates,num_jeux from JEUX");
    while(rs.next()){
      GameInfo gi = new GameInfo();
      gi.setNom(rs.getString(1));
      gi.setDescription(rs.getString(2));
      gi.setControls(rs.getString(3));
      gi.setNbOfPlays(rs.getInt(4));
      gi.setNbOfRates(rs.getInt(5));
      gi.setRate(rs.getInt(6));
      gi.setNum(rs.getInt(7));
      listOfGame.add(gi);
    }
   
    ListOfGames.setListOfGames(listOfGame);
    }catch(Exception e){
View Full Code Here


   */
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  JDBCGameDAO game = new JDBCGameDAO();
  if(request.getParameter("game")!=null){
    game.increaseNbOfPlays(request.getParameter("game"));
    GameInfo gameInfo =game.getGameInfo(request.getParameter("game"));
    request.setAttribute("game", gameInfo);
    request.getRequestDispatcher("game.jsp").forward(request, response);
    /*out.println("<embed src='http://localhost:8080/in56/"+gameInfo.getNom()+".swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' height='480' width='720'/>");
    out.println("<br>Description<br>"+gameInfo.getDescription());
    out.println("<br>Controles<br>"+gameInfo.getControls());
View Full Code Here

  return games;
  }
  @Override
  public GameInfo getGameInfo(String nom) {
    Connection con=null;
    GameInfo gi = new GameInfo();
    try{
      con= getDataSource().getConnection();
     
    PreparedStatement pstmt = con.prepareStatement("select description,controls,numberofplay,numberofrates,rates,num_jeux,lien from JEUX where nom=?");
    pstmt.setString(1, nom);
    ResultSet rs = pstmt.executeQuery();
    if(rs.next()){
      gi.setNom(nom);
      gi.setDescription(rs.getString(1));
      gi.setControls(rs.getString(2));
      gi.setNbOfPlays(rs.getInt(3));
      gi.setNbOfRates(rs.getInt(4));
      gi.setRate(rs.getInt(5));
      gi.setNum(rs.getInt(6));
      gi.setLien(rs.getString(7));
    }
    }catch(Exception e){
      System.out.println("probleme de connection");
      e.printStackTrace();
    }finally{
View Full Code Here

   
  }
  @Override
  public GameInfo getGameOfTheMonth() {
    Connection con=null;
    GameInfo gi = new GameInfo();
    try{
      con= getDataSource().getConnection();
      Statement stmt=con.createStatement();
    ResultSet rs = stmt.executeQuery("select description,controls,numberofplay,numberofrates,rates,nom from JEUX where jeux_du_mois=1");
    if(rs.next()){
     
      gi.setDescription(rs.getString(1));
      gi.setControls(rs.getString(2));
      gi.setNbOfPlays(rs.getInt(3));
      gi.setNbOfRates(rs.getInt(4));
      gi.setRate(rs.getInt(5));
      gi.setNom(rs.getString(6));
    }
    }catch(Exception e){
      System.out.println("probleme de connection");
      e.printStackTrace();
    }finally{
View Full Code Here

TOP

Related Classes of beans.GameInfo

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.