IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Services Web Java Discussion :

Probléme d'ajout d'opération


Sujet :

Services Web Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Femme Profil pro
    Étudiant
    Inscrit en
    Mars 2011
    Messages
    24
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Mars 2011
    Messages : 24
    Par défaut Probléme d'ajout d'opération
    Salut

    j'ai crée un web service java en utilisaant netbeans , avec une seule opération
    , en le testant ça marche bien !

    mais quand j'ai ajouté une deuxième opération : une erreur m'affiche


    edeploy?name=WebApplication2&properties=keepSessions=true failed on GlassFish Server 3
    C:\...\WebApplication2\nbproject\build-impl.xml:687: The module has not been deployed.
    BUILD FAILED (total time: 1 minute 52 seconds)


    pouvez vous m'aidez SVP?

  2. #2
    Membre éclairé Avatar de rockley
    Homme Profil pro
    Inscrit en
    Décembre 2010
    Messages
    404
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Décembre 2010
    Messages : 404
    Par défaut
    Salut

    Tu peux mettre ton code ?

  3. #3
    Membre averti
    Femme Profil pro
    Étudiant
    Inscrit en
    Mars 2011
    Messages
    24
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Mars 2011
    Messages : 24
    Par défaut
    salut

    merci bien pour votre réponse

    le code est le suivant
    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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
     
    package packageIden;
     
    import com.mysql.jdbc.ResultSetMetaData;
    import java.awt.Dimension;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.swing.*;
    import javax.swing.table.TableCellRenderer;
    import packageIden.ListedeRecherche.ImageRenderer;
     
     
    /**
     *
     * @author darina
     */
    @WebService()
    public class Iden {
     
        /**
         * Web service operation
         */
        @WebMethod(operationName = "IdenOperation")
        public String IdenOperation(@WebParam(name = "login")
        String login, @WebParam(name = "pass")
        String pass) {
            //TODO write your implementation code here:
             String nnoomm = null;
             try {
                String username = "root";
                String password = "0000";
                Statement stmt;
                ResultSet rs;
     
                Class.forName("com.mysql.jdbc.Driver").newInstance();
     
     
                String url = new String("jdbc:mysql://localhost:3306/iptv");
                Connection conn = DriverManager.getConnection(url, username, password);
                System.out.println("OK connexion réussie...");
     
     
                stmt = conn.createStatement();
                rs = stmt.executeQuery("select * from clients");
     
              //  String l=jTextField1.getText();
               // String m=jPasswordField2.getText();
     
                while (rs.next())
                 {
                 String l1 = rs.getString("login");
                 String m1 = rs.getString("password");
                     if ((l1.equals(login))&& (m1.equals(pass)))
                     { String nom = rs.getString("nom");
                       System.out.println(nom + "\n");
                       nnoomm=nom;
                      // Menu  m= new Menu();// question ici ? : es-ce que c'est illogique d'envoyer un jframe dans un web service 
                      // m.setVisible(true);
                     // a.setSize(new Dimension (800,500));
     
                     }
                 /*else {  JOptionPane.showMessageDialog(null, "Valeur incorrecte de nom d’utilisateur ou/et de mot de passe. " , "Erreur",
            JOptionPane.ERROR_MESSAGE);
                     }*/
     
                }
               // System.out.println("Valeur de nnoomm : "+nnoomm);
                 //nnoomm=rs.getString("nom");
     
     
     
                rs.close();
                stmt.close();
                conn.close();
                System.out.println("Déconnexion réussie...");
     
            } catch (SQLException ex) {
                System.out.println("exception"+ex.toString());
     
            } catch (InstantiationException ex) {
                System.out.println("exception"+ex.toString());
     
     
            } catch (IllegalAccessException ex) {
                System.out.println("exception"+ex.toString());
     
            } catch (ClassNotFoundException ex) {
     
                System.out.println("exception"+ex.toString());
     
     
            }
    return ("Welcome " +nnoomm);
        }
     
        /**
         * Web service operation
         */
        @WebMethod(operationName = "SearchOperation")
        public JTable SearchOperation(@WebParam(name = "KeyWord")
        String KeyWord) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException {
            String[] columnNames = {"Videos","Information"};
            JTable table = null;
            //---------Cconnexion à la base de données:----------------------
            String username = "root";
            String password = "0000";
            Statement stmt;
            ResultSet rs;
            Class.forName("com.mysql.jdbc.Driver").newInstance();
            String url = "jdbc:mysql://localhost:3306/mabase";
            Connection conn = (Connection) DriverManager.getConnection(url, username, password);
            System.out.println("OK connexion réussie...");
            String Vid ="forgiveMe";// jTextField1.getText();---!!! à modifier
            stmt = (Statement) conn.createStatement();
            rs = stmt.executeQuery("select * from videos where nomVideo='"+Vid+"'");//---!!!ou description à ajouter ultérieurement
            String name=rs.getString("nomVideo");
            ResultSetMetaData md = (ResultSetMetaData) rs.getMetaData();
            rs.last();
            int NbreResultats=rs.getRow();
            System.out.println("Le nombre des résultats vaut "+NbreResultats);// to del
            //int columns = md.getColumnCount();// not for use now
            Object[][] data = new Object[NbreResultats][columnNames.length];
            rs.beforeFirst();
            String NEWLINE = System.getProperty("line.separator");
     
            while (rs.next()) {
     
            String inf="";
            inf=inf+" Nom de la vidèo :"+rs.getString("nomVideo")+NEWLINE+
                    " Catégorie       :"+rs.getString("categorie")+NEWLINE+
                    " Durée           :"+rs.getString("duree")+NEWLINE;
            String Ligne1=" Nom de la vidèo :"+rs.getString("nomVideo");
            String Ligne2=" Catégorie       :"+rs.getString("categorie");
            String Ligne3=" Durée           :"+rs.getString("duree");
            String im=rs.getString("lien");
            System.out.println(im);// to del
            JLabel label =new JLabel("<html>"+Ligne1+"<br>"+Ligne2+"<br>"+Ligne3+"</html>");
            System.out.println(inf);
            //ImageIcon ic= new ImageIcon("chemin de l image");
     
            data[0][0]=null;
            data[0][1]=label.getText();
     
            System.out.println(data[0][1].toString());
            rs.close();
            stmt.close();
            table = new JTable(data, columnNames);//enlever final
            table.setPreferredScrollableViewportSize(new Dimension(958, 581));
            table.setFillsViewportHeight(true);
            //table.setDefaultRenderer(null, this);
            ImageIcon iconv = new ImageIcon(im);
           // table.getColumnModel().getColumn(0).setCellRenderer((TableCellRenderer) new ImageRenderer());//importanteeeeee
            table.setRowHeight(300);
            JScrollPane scrollPane = new JScrollPane(table);//Create the scroll pane and add the table to it.
            table.add(scrollPane);//Add the scroll pane to this panel.
     
        }
     
        /**
         * Web service operation
         */
     
     return table;
        }
        }
    Merciiiiiiiiiiiiiiiiiiiiiiiiiiiiii

Discussions similaires

  1. problème d'ajout et suppression de programmes
    Par ran_hery dans le forum Windows XP
    Réponses: 2
    Dernier message: 14/12/2005, 12h21
  2. [ECLIPSE WT] Problème d'ajout du serveur Tomcat
    Par SEMPERE Benjamin dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 12/12/2005, 12h20
  3. Problème d'ajout de mois
    Par auriolbeach dans le forum Access
    Réponses: 5
    Dernier message: 02/10/2005, 22h22
  4. Problème d'ajout d'imprimante sur LPT1
    Par arnaud_verlaine dans le forum Périphériques
    Réponses: 10
    Dernier message: 15/03/2005, 22h23
  5. Problème d'ajout multiples dans un BDD Access
    Par arnaud_verlaine dans le forum Langage SQL
    Réponses: 3
    Dernier message: 31/05/2004, 13h34

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo