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

Agents de placement/Fenêtres Java Discussion :

ouvrir une fenetre a partir d une autre


Sujet :

Agents de placement/Fenêtres Java

  1. #1
    Membre à l'essai

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2016
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juin 2016
    Messages : 11
    Points : 12
    Points
    12
    Billets dans le blog
    1
    Par défaut ouvrir une fenetre a partir d une autre
    bonjour chers amis j'ai le meme probleme...mais le mien es un peu different et c'est sur netbeans quand je clic sur le button ouvrir rien se passe c'est comme si on avait rien lance et dans la notification de netbeans on me qu'il y a erreur au niveau de querySelectAll aidez moi s'il vous plait....

  2. #2
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Salut,

    Si tu as une erreur pendant l'ouverture de la fenêtre, c'est normal qu'elle ne s'affiche pas.

    Quel est le code ? Quel est exactement le message d'erreur (et tant qu'à faire la stackTrace) ?
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  3. #3
    Membre à l'essai

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2016
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juin 2016
    Messages : 11
    Points : 12
    Points
    12
    Billets dans le blog
    1
    Par défaut ouverture de JFrame
    sa c'est l'erreur qui signale dans le "out"





    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username'ASSASD' and password='sdddd'' at line 1
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at base_de_donne�.Login.jButton2ActionPerformed(Login.java:112)
    at base_de_donne�.Login.access$100(Login.java:16)
    at base_de_donne�.Login$2.actionPerformed(Login.java:85)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6533)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

  4. #4
    Membre averti
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2014
    Messages
    352
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2014
    Messages : 352
    Points : 349
    Points
    349
    Par défaut
    Salut.

    Citation Envoyé par akira1994 Voir le message
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username'ASSASD' and password='sdddd'' at line 1
    T'as une erreur dans ta requête SQL plus précisément après le "WHERE" tu oublies de mettre le signe de comparaison entre "username" et la valeur.
    Si le problème persiste,il serait mieux de suivre les consignes de @joel.drigo : montrer ton code.

  5. #5
    Membre à l'essai

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2016
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juin 2016
    Messages : 11
    Points : 12
    Points
    12
    Billets dans le blog
    1
    Par défaut ouverture de JFrame
    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
    package base_de_donne�;
     
    import Application.BDD;
    import Application.Parameter;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JOptionPane;
    public class Login extends javax.swing.JFrame {
    //d閏laration   
     
    ResultSet rs;
        BDD db;
        String username1, password1, hak;
     
     
     
        public Login() {
    db = new BDD(new Parameter().HOST_DB, new Parameter().USERNAME_DB,new Parameter()
             .PASSWORD_DB, new Parameter().IPHOST, new Parameter().PORT);              
     
            initComponents();
        }
     
        /**
         * This method is called from within the constructor to initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is always
         * regenerated by the Form Editor.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
        private void initComponents() {
     
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            txt_password = new javax.swing.JTextField();
            txt_username = new javax.swing.JTextField();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
     
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            getContentPane().setLayout(null);
     
            jLabel1.setFont(new java.awt.Font("Times New Roman", 3, 48)); // NOI18N
            jLabel1.setForeground(new java.awt.Color(51, 204, 255));
            jLabel1.setText("Login");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(151, 26, 163, 67);
     
            jLabel2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
            jLabel2.setText("username :");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(39, 125, 88, 22);
     
            jLabel3.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
            jLabel3.setText("password :");
            getContentPane().add(jLabel3);
            jLabel3.setBounds(40, 210, 86, 22);
     
            txt_password.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
            getContentPane().add(txt_password);
            txt_password.setBounds(173, 210, 130, 30);
     
            txt_username.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
            getContentPane().add(txt_username);
            txt_username.setBounds(173, 125, 130, 30);
     
            jButton1.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
            jButton1.setText("fermer");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
                }
            });
            getContentPane().add(jButton1);
            jButton1.setBounds(190, 280, 90, 40);
     
            jButton2.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
            jButton2.setText("Login");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
                }
            });
            getContentPane().add(jButton2);
            jButton2.setBounds(40, 280, 90, 40);
     
            pack();
        }// </editor-fold>                        
     
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
    dispose();
        }                                        
     
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
     
    rs = db.querySelectAll("utilisateur", "username='" + txt_username.getText()
            +"' and password='" + txt_password.getText() + "'");
            try{
               while(rs.next()){
                   username1 = rs.getString("username");
                   password1 = rs.getString("password");
                   hak = rs.getString("type");
               }
            }catch(SQLException ex){
               Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
            }
     
            if(username1 == null && password1 == null){ 
               JOptionPane.showMessageDialog(this, "le nom utilisateur ou le mot de pass est incorrect");
            }else{
               if (hak.equals("directeur")){
                   Principale h = new Principale();
                   h.setVisible(true);
                   this.dispose();
               }else{
                  Cachier k = new Cachier();
                  k.setVisible(true);
                  this.dispose();
               }
            }
     
        }                                        
     
        /**
         * @param args the command line arguments
         */
        public static void main(String args[]) {
            /* Set the Nimbus look and feel */
            //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
            /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
             * For details see <a href="http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html" target="_blank">http://download.oracle.com/javase/tu...feel/plaf.html</a> 
             */
            try {
                for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Nimbus".equals(info.getName())) {
                        javax.swing.UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (ClassNotFoundException ex) {
                java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
            //</editor-fold>
     
            /* Create and display the form */
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Login().setVisible(true);
                }
            });
        }
     
        // Variables declaration - do not modify                     
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JTextField txt_password;
        private javax.swing.JTextField txt_username;
        // End of variables declaration                   
    }

  6. #6
    Membre averti
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2014
    Messages
    352
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2014
    Messages : 352
    Points : 349
    Points
    349
    Par défaut
    Citation Envoyé par akira1994 Voir le message
    rs = db.querySelectAll("utilisateur", "username='" + txt_username.getText()
    +"' and password='" + txt_password.getText() + "'");
    Salut.
    Est-ce que tu peux nous montrer le code de ta méthode querySelectAll.
    Au passage utilise les balises code histoire de nous faciliter la navigation dans le code que tu postes et dis nous aussi le composant censé produire l'effet attendu.

  7. #7
    Membre à l'essai

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2016
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juin 2016
    Messages : 11
    Points : 12
    Points
    12
    Billets dans le blog
    1
    Par défaut Ouverture JFrame
    je ne sais comment utiliser les balises codes




    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
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    package Application;
     
     
    import java.net.Socket;
     
    import java.sql.*;
     
     
     
    public class BDD {
     
    //    les d閏larations
     
        Connection connection;
        Statement statement;
        String SQL;
     
    String url;
        String username;
        String password;
        Socket client;
        int Port;
        String Host;
     
     
    public BDD (String url, String username, String password, String Host, int Port){ 
          this.url = url;
          this.username = username;
          this.password = password;
          this.Host = Host;
          this.Port = Port;
        }   
     
     
    //fonction pour faire connection au base de donne�
    public Connection connexionDatabase() {
     try {
               Class.forName("com.mysql.jdbc.Driver");
     
     connection = DriverManager.getConnection(url, username, password);
           } catch(Exception e)
    {System.err.println(e.getMessage());//e.getMessage est pour afficher ou se trouve le prbleme exavtement err pour
    //afficher le erreur err
           }
           return connection;
        }
     
     
     
     
    //fonction pour fermer la base de donne�
     
    public Connection closeconnexion()   {
     
         try {
             connection.close();
         } catch(Exception e)  {System.err.println(e);//
         }
         return connection;
    }
     
     
    //fonction pour l'execution de requete
     
    public  ResultSet ex閏utionQuery(String sql) {
        connexionDatabase();
        ResultSet resultSet = null;
        try {
            statement = connection.createStatement();
            resultSet = statement.executeQuery(sql);
            System.out.println(sql);
        } catch (SQLException ex){System.err.println(ex);//
        }
        return resultSet;
    }
     
     
    // pour execution de requete update
        public String ex閏utionUpdate(String sql) {
        connexionDatabase();
        String result = "";
        try {
            statement = connection.createStatement();
            statement.executeUpdate(sql);
            result = sql;
     
        } catch (SQLException ex) {
           result = ex.toString();
        }
       return result;
    }
     
     
    //fonction de requete pour afficher Tous
    public ResultSet querySelectAll(String nomTable) {
     
        connexionDatabase();
        SQL = "SELECT * FROM " + nomTable;
        System.out.println(SQL);
        return this.ex閏utionQuery(SQL);    
    }
     
    //fonction pour afficher Tous avec de parameter ("etat")
    public ResultSet querySelectAll(String nomTable, String 閠at){
     
      connexionDatabase();
      SQL = "SELECT * FROM " + " WHERE " + 閠at;
      return this.ex閏utionQuery(SQL);
    }
     
     
    //
    public ResultSet querySelect(String[] nomColonne, String nomTable) {
     
     connexionDatabase();
     int i;
     SQL = "SELECT ";
     
     for (i = 0; i<= nomColonne.length - 1; i++) {
         SQL += nomColonne[i];
         if (i < nomColonne.length - 1) {
            SQL += ",";
         }
     }
     
     SQL += " FROM " + nomTable;
     return this.ex閏utionQuery(SQL);
     
     }
     
     
    //
    public ResultSet fcSelectCommand (String[] nomColonne, String nomTable, String 閠at) {
     
        connexionDatabase();
        int i;
        SQL = "SELECT ";
     
        for (i = 0; i <= nomColonne.length - 1; i++) {
            SQL += nomColonne[i];
            if (i < nomColonne.length - 1) {
                SQL += ",";
            }
        }
     
        SQL += " FROM " + nomTable + " WHERE " + 閠at;
        return this.ex閏utionQuery(SQL);
    }
     
     
     
     
    //fonction de entrer de donne�
                   public String queryInsert(String nomTable, String[] contenuTableau) {
     
        connexionDatabase();
        int i;
        SQL = "INSERT INTO " + nomTable + " VALUES(";
     
        for (i = 0; i <= contenuTableau.length - 1; i++) {
            SQL += "'" + contenuTableau[i] + "'";
            if (i < contenuTableau.length - 1) {
                SQL +=",";
            }
        }
     
        SQL +=")";
        return this.ex閏utionUpdate(SQL);
    }
     
     
     
     
     
     
    //
    public String queryInsert(String nomTable, String[] nomColonne, String[] contenuTableau) {
     
        connexionDatabase();
        int i;
        SQL = "INSERT INTO " + nomTable + "(";
        for (i = 0; i <= nomColonne.length - 1; i++) {
            SQL += nomColonne[i];
            if (i < nomColonne.length - 1){
               SQL += ",";
            }
        }
        SQL += ") VALUES(";
        for (i = 0; i <= contenuTableau.length - 1; i++){
            SQL += "'" + contenuTableau[i] + "'";
            if (i < contenuTableau.length - 1){
               SQL += ",";
            }
        }
     
        SQL += ")";
        return this.ex閏utionUpdate(SQL);
    }
     
     
     
     
    //
    public String queryUpdate(String nomTable, String[] nomColonne, String[] contenuTableau, String 閠at) { 
     
      connexionDatabase();
      int i;
      SQL = "UPDATE " + nomTable + " SET ";
     
      for (i = 0; i <= nomColonne.length - 1; i++){
          SQL += nomColonne[i] + "='" + contenuTableau[i] + "'";
          if (i < nomColonne.length - 1) {
             SQL += ",";
          }
      }
     
      SQL += " WHERE " + 閠at;
      return this.ex閏utionUpdate(SQL);
     
    }
     
     
     
    //fonction pour la requete supprimer sans parameter
      public String queryDelete(String nomtable) {
     
      connexionDatabase();
      SQL = "DELETE FROM " + nomtable;
      return this.ex閏utionUpdate(SQL);
    }
     
     
     
     
    //fonction pour requete supprimer avec parameter
     
    public String queryDelete(String nomTable, String 閠at){
     
        connexionDatabase();
        SQL = "DELETE FROM " + nomTable + " WHERE " + 閠at;
        return this.ex閏utionUpdate(SQL);
     
        }
    }

  8. #8
    Membre averti
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2014
    Messages
    352
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2014
    Messages : 352
    Points : 349
    Points
    349
    Par défaut
    Citation Envoyé par akira1994 Voir le message
    je ne sais comment utiliser les balises codes
    Regarde dans la barre d'outils qui se trouve au milieu y a un symbole # à la fin.
    Clique dessus et tu verras 2 balises l'une ouvrante et l'autre fermante insère ton code entre ces 2 balises.

  9. #9
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Citation Envoyé par akira1994 Voir le message
    je ne sais comment utiliser les balises codes
    http://www.developpez.net/forums/mis...do=bbcode#code

    et reformate ton message, parce que sans l'indentation, c'est imbuvable à lire

  10. #10
    Membre à l'essai

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2016
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juin 2016
    Messages : 11
    Points : 12
    Points
    12
    Billets dans le blog
    1
    Par défaut ouverture JFrame
    mon phone ne peut pas utiliser les balises code desole mais je devoir poster mes codes directement sans les balises

  11. #11
    Membre averti
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2014
    Messages
    352
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2014
    Messages : 352
    Points : 349
    Points
    349
    Par défaut
    Citation Envoyé par akira1994 Voir le message
    mon phone ne peut pas utiliser les balises code desole mais je devoir poster mes codes directement sans les balises


    Les touches de nos claviers se bloquent dès que nous essayons d'écrire quelque chose qui peut t'aider

  12. #12
    Membre à l'essai

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2016
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juin 2016
    Messages : 11
    Points : 12
    Points
    12
    Billets dans le blog
    1
    Par défaut ouverture JFrame
    et pourtant c'est vraiment quand je clic pour utiliser les balises sa mais conection impossible....ou vous croyez que je n'est pas essayer

  13. #13
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username'ASSASD' and password='sdddd''
    .

    A priori, il manque une quote à la fin pour fermer celle de 'sdddd. Tu n'aurais pas ce probème si tu utilisais un PreparedStatement pour faire ta requête.
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  14. #14
    Membre à l'essai

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2016
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juin 2016
    Messages : 11
    Points : 12
    Points
    12
    Billets dans le blog
    1
    Par défaut ouverture JFrame
    d'accord je vais essayer!!!

  15. #15
    Nouveau Candidat au Club
    Homme Profil pro
    administrateur de base donnees
    Inscrit en
    Janvier 2013
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : administrateur de base donnees
    Secteur : Services de proximité

    Informations forums :
    Inscription : Janvier 2013
    Messages : 1
    Points : 1
    Points
    1
    Par défaut
    Oui je vois j'ai egalement ete confronte a ce probleme pour le contourner j'ai utilisé la requête << "select * from user where username = ? and password = ?";>>

    avec <<PreparedStatement>> . Essaie cette piste voir.

Discussions similaires

  1. Ouvrir une fenetre modale à partir d'une autre
    Par sabdoul dans le forum jQuery
    Réponses: 4
    Dernier message: 05/08/2014, 12h39
  2. acceder a une fenetre a partir d'un autre projet
    Par agrégation dans le forum VB 6 et antérieur
    Réponses: 1
    Dernier message: 21/03/2009, 11h18
  3. ouvrir une fenetre a partir d une autre
    Par beraaa dans le forum AWT/Swing
    Réponses: 1
    Dernier message: 30/12/2007, 12h56
  4. ouvrir une fenetre a partir d'une autre
    Par kain_tn dans le forum AWT/Swing
    Réponses: 8
    Dernier message: 24/05/2006, 13h38
  5. Réponses: 2
    Dernier message: 03/02/2006, 16h21

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