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{