Bonjour,
pour un nouveau projet, c'est comme un youtube mais avec la possibilité de traduire en plusieurs langues chaque vidéo. J'utilise le pattern design DAO. J'ai donc fait plusieurs classes dans le package.
Dans mon implémentation de méthodes j'ai des erreurs qui surviennent dans ma classe videoDaoIplm.java.
Voici mon code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 public List<Video> lister() throws DaoException {
        List<Video> videos = new ArrayList<Video>();
        Connection connexion = null;
        Statement statement = null;
        ResultSet resultat = null;
 
        try {
 
         connexion = DaoFactory.getConnection(); /// erreurr sur getConnexion
            statement = connexion.createStatement();
            resultat = statement.executeQuery("SELECT fichier, titre, commentaire FROM video;");
 
            while (resultat.next()) {
 
             String fichier = resultat.getString("fichier");
                String titre = resultat.getString("titre");
                String commentaire = resultat.getString("commentaire");
 
                Video video = new Video();
                Video.setfichier(fichier); // erreur sur setfichier
                Video.settitre[(titre); // erreur sur settitre
                Video.setcommentaire(commentaire); //erreurr sur setcommantaire
 
                Video.add(video);
            }
        } catch (SQLException e) {
            throw new DaoException("Impossible de communiquer avec la base de données; SQLException");
        } catch (BeanException e) {
            throw new DaoException("Les données de la base sont invalides: bean");
        }
        finally {
            try {
                if (connexion != null) {
                    connexion.close();  
                }
            } catch (SQLException e) {
                throw new DaoException("Impossible de communiquer avec la base de données : fermeture");
            }
        }
        return videos;
    }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
connexion = DaoFactory.getConnection();
Creates a Statement object for sending SQL statements to the database. SQL statements without parameters are normally executed using Statement objects. If the same SQL statement is executed many times, it may be more efficient to use a PreparedStatement object.

Result sets created using the returned Statement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY. The holdability of the created result sets can be determined by calling getHoldability.

Returns:
a new default Statement object
Throws:
SQLException - if a database access error occurs or this method is called on a closed connection

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 Video video = new Video();
                Video.setfichier(fichier);
                Video.settitre(titre);
                Video.setcommentaire(commentaire);
The method setfichier(String) is undefined for the type Video

The method add(Video) is undefined for the type Video
Je voudrais comprendre pourquoi il affiche cette erreur, tandis que les autres méthodes n'affichent pas d'erreurs ?

Salutations
philippe