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

JDBC Java Discussion :

Besoin D'aide (Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException


Sujet :

JDBC Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Candidat au Club
    Inscrit en
    Décembre 2008
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Décembre 2008
    Messages : 2
    Par défaut Besoin D'aide (Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    Bonjour à Tous,

    Merci à tous pour votre aide

    Voici tout d'abord mon erreur

    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at medisoft.PatientDB.AddPatient(PatientDB.java:39)
    at medisoft.Ajouter.jButton3_actionPerformed(Ajouter.java:247)
    at medisoft.Ajouter_jButton3_actionAdapter.actionPerformed(Ajouter.java:290)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1774)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    Et Voici Les classe d'ou vient l'erreur

    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
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    package medisoft;
    import java.awt.BorderLayout;
     
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import java.awt.Rectangle;
    import java.awt.Font;
    import javax.swing.SwingConstants;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.JList;
    import javax.swing.JRadioButton;
    import javax.swing.ButtonGroup;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import java.awt.Color;
    import javax.swing.BorderFactory;
    import java.awt.SystemColor;
    import javax.swing.JOptionPane;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyAdapter;
     
     
    public class Ajouter extends JFrame {
        public Ajouter() {
            try {
                jbInit();
            } catch (Exception exception) {
                exception.printStackTrace();
            }
        }
     
        private void jbInit() throws Exception {
            this.getContentPane().setBackground(SystemColor.inactiveCaption);
            this.setCursor(null);
            this.setJMenuBar(null);
            this.setResizable(false);
            this.setTitle("Gestionaire MEDISOFT");
            this.setVisible(true);
            this.getContentPane().setLayout(null);
            this.setBounds(200,100,630,520);
            jLabel1.setFont(new java.awt.Font("Tahoma", Font.BOLD, 15));
            jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
            jLabel1.setText("Nouveau Patient");
            jLabel1.setBounds(new Rectangle(0, 12, 630, 29));
            jLabel2.setText("Nom & Prénom");
            jLabel2.setBounds(new Rectangle(62, 72, 99, 14));
            jLabel3.setText("CIN");
            jLabel3.setBounds(new Rectangle(62, 108, 50, 14));
            jLabel4.setText("Sexe");
            jLabel4.setBounds(new Rectangle(62, 141, 64, 14));
            jLabel5.setText("Adresse");
            jLabel5.setBounds(new Rectangle(62, 179, 71, 14));
            jLabel6.setText("Téléphone");
            jLabel6.setBounds(new Rectangle(62, 211, 67, 14));
            jLabel7.setText("Médecin Traitant");
            jLabel7.setBounds(new Rectangle(62, 243, 100, 14));
            jLabel8.setText("Mutualiste");
            jLabel8.setBounds(new Rectangle(62, 277, 96, 14));
            jLabel9.setText("Antécédants Médicaux");
            jLabel9.setBounds(new Rectangle(62, 308, 131, 14));
            jTextArea1.setBorder(BorderFactory.createEtchedBorder());
            jTextArea1.setBounds(new Rectangle(197, 308, 205, 80));
            jTextField2.setBounds(new Rectangle(197, 243, 205, 19));
            jTextField3.setBounds(new Rectangle(197, 211, 205, 19));
            jTextField4.setBounds(new Rectangle(197, 179, 205, 19));
            jRadioButton1.setBackground(SystemColor.inactiveCaption);
            jRadioButton1.setSelected(true);
            jRadioButton1.setText("Masculin");
            jRadioButton1.setBounds(new Rectangle(196, 139, 94, 21));
            jRadioButton1.addActionListener(new Ajouter_jRadioButton1_actionAdapter(this));
            jRadioButton2.setBackground(SystemColor.inactiveCaption);
            jRadioButton2.setText("Féminin");
            jRadioButton2.setBounds(new Rectangle(292, 138, 93, 23));
            jLabel13.setFont(new java.awt.Font("Tahoma", Font.BOLD | Font.ITALIC,
                                               11));
            jLabel13.setForeground(Color.darkGray);
            jLabel13.setText("Seules les Lettres sont Acceptées");
            jLabel13.setBounds(new Rectangle(412, 243, 205, 19));
            jLabel11.setFont(new java.awt.Font("Tahoma", Font.BOLD | Font.ITALIC,
                                               11));
            jLabel11.setForeground(Color.darkGray);
            jLabel11.setText("Seules les Lettres sont Acceptées");
            jLabel11.setBounds(new Rectangle(412, 72, 205, 19));
            jRadioButton3.setBackground(SystemColor.inactiveCaption);
            jRadioButton3.setSelected(true);
            jRadioButton3.setText("Oui");
            jRadioButton3.setBounds(new Rectangle(200, 277, 93, 23));
            jRadioButton4.setBackground(SystemColor.inactiveCaption);
            jRadioButton4.setText("Non");
            jRadioButton4.setBounds(new Rectangle(292, 277, 93, 23));
            jLabel12.setFont(new java.awt.Font("Tahoma", Font.BOLD | Font.ITALIC,
                                               11));
            jLabel12.setForeground(Color.darkGray);
            jLabel12.setText("Seuls les Chiffres sont Acceptés");
            jLabel12.setBounds(new Rectangle(412, 211, 205, 19));
            radioGroup.add(jRadioButton1);
            radioGroup.add(jRadioButton2);
            radioGroup2.add(jRadioButton3);
            radioGroup2.add(jRadioButton4);
            jTextField5.setBounds(new Rectangle(197, 108, 205, 19));
            jTextField6.setBounds(new Rectangle(197, 72, 205, 19));
            jButton1.setBounds(new Rectangle(93, 423, 130, 23));
            jButton1.setToolTipText("Retour au Menu Principal");
            jButton1.setText("Menu Principal");
            jButton1.addActionListener(new Ajouter_jButton1_actionAdapter(this));
            jButton2.setBounds(new Rectangle(467, 423, 73, 23));
            jButton2.setToolTipText("Retour à la Gestion des Patients");
            jButton2.setText("Retour");
            jButton2.addActionListener(new Ajouter_jButton2_actionAdapter(this));
            jButton3.setBounds(new Rectangle(280, 423, 106, 23));
            jButton3.setToolTipText("Enregistrer le Patient");
            jButton3.setText("Enregistrer");
            jButton3.addActionListener(new Ajouter_jButton3_actionAdapter(this));
            this.getContentPane().add(jLabel1);
            this.getContentPane().add(jLabel2);
            this.getContentPane().add(jLabel3);
            this.getContentPane().add(jLabel5);
            this.getContentPane().add(jLabel6);
            this.getContentPane().add(jLabel7);
            this.getContentPane().add(jLabel8);
            this.getContentPane().add(jLabel4);
            this.getContentPane().add(jLabel9);
            this.getContentPane().add(jTextArea1);
            this.getContentPane().add(jTextField2);
            this.getContentPane().add(jTextField3);
            this.getContentPane().add(jTextField4);
            this.getContentPane().add(jRadioButton2);
            this.getContentPane().add(jTextField5);
            this.getContentPane().add(jTextField6);
            this.getContentPane().add(jLabel11);
            this.getContentPane().add(jLabel13);
            this.getContentPane().add(jRadioButton3);
            this.getContentPane().add(jRadioButton4);
            this.getContentPane().add(jLabel12);
            this.getContentPane().add(jRadioButton1);
            this.getContentPane().add(jButton3);
            this.getContentPane().add(jButton1);
            this.getContentPane().add(jButton2);
            jTextField3.addKeyListener(new java.awt.event.KeyAdapter() {
                public void keyTyped(KeyEvent source) {
                    int k = source.getKeyChar();
                    if (k == 46)
                        source.setKeyChar((char) KeyEvent.VK_CLEAR);
                    else if ((k > 47 && k < 58) ||
                             (k == 8 || k == KeyEvent.VK_PERIOD)) {} else {
                        source.setKeyChar((char) KeyEvent.VK_CLEAR);
                    }
                }
            });
            jTextField6.addKeyListener(new KeyAdapter() {
                public void keyTyped(KeyEvent source) {
                    int k = source.getKeyChar();
                    if (k == 46)
                        source.setKeyChar((char) KeyEvent.VK_CLEAR);
                    else if ((k > 64 && k < 91) || (k > 96 && k < 123) ||
                             (k == 8 || k == KeyEvent.VK_PERIOD)) {} else {
                        source.setKeyChar((char) KeyEvent.VK_CLEAR);
                    }
                }
            });
            jTextField2.addKeyListener(new KeyAdapter() {
                public void keyTyped(KeyEvent source) {
                    int k = source.getKeyChar();
                    if (k == 46)
                        source.setKeyChar((char) KeyEvent.VK_CLEAR);
                    else if ((k > 64 && k < 91) || (k > 96 && k < 123) ||
                             (k == 8 || k == KeyEvent.VK_PERIOD)) {} else {
                        source.setKeyChar((char) KeyEvent.VK_CLEAR);
                    }
                }
            });
      }
        PatientDB sdb =  new PatientDB();
        JLabel jLabel1 = new JLabel();
        JLabel jLabel2 = new JLabel();
        JLabel jLabel3 = new JLabel();
        JLabel jLabel4 = new JLabel();
        JLabel jLabel5 = new JLabel();
        JLabel jLabel6 = new JLabel();
        JLabel jLabel7 = new JLabel();
        JLabel jLabel8 = new JLabel();
        JLabel jLabel9 = new JLabel();
        JTextArea jTextArea1 = new JTextArea();
        JTextField jTextField2 = new JTextField();
        JTextField jTextField3 = new JTextField();
        JTextField jTextField4 = new JTextField();
        JRadioButton jRadioButton1 = new JRadioButton();
        JRadioButton jRadioButton2 = new JRadioButton();
        ButtonGroup radioGroup = new ButtonGroup();
        ButtonGroup radioGroup2 = new ButtonGroup();
        JTextField jTextField5 = new JTextField();
        JTextField jTextField6 = new JTextField();
        JButton jButton1 = new JButton();
        JButton jButton2 = new JButton();
        JButton jButton3 = new JButton();
        JLabel jLabel13 = new JLabel();
        JLabel jLabel11 = new JLabel();
        JRadioButton jRadioButton3 = new JRadioButton();
        JRadioButton jRadioButton4 = new JRadioButton();
        JLabel jLabel12 = new JLabel();
        public void jRadioButton1_actionPerformed(ActionEvent actionEvent) {
     
        }
     
        public void jButton2_actionPerformed(ActionEvent actionEvent) {
            this.setVisible(false);
            General layout = new General();
            layout.setVisible(true);
        }
     
        public void jButton3_actionPerformed(ActionEvent actionEvent) {
            String gender, mutualiste;
            gender = "Masculin";
            mutualiste = "Non";
           if (jTextArea1.getText().compareTo("") == 0 ||
                jTextField2.getText().compareTo("") == 0 ||
                jTextField3.getText().compareTo("") == 0 ||
                jTextField4.getText().compareTo("") == 0 ||
                jTextField5.getText().compareTo("") == 0 ||
                jTextField6.getText().compareTo("") == 0) {
              String ms = "Veuillez remplir tous les champs requis. SVP!!";
              JOptionPane.showMessageDialog(null, ms);
            }
            else {
                  if(jRadioButton1.isSelected())
                      gender="Masculin";
                  else
                      gender="Féminin";
                  if(jRadioButton3.isSelected())
                      mutualiste = "Oui";
                  else
                      mutualiste = "Non";
     
                  sdb.AddPatient(jTextField6.getText().toString(), jTextField5.getText().toString(),
                                 gender, jTextField4.getText().toString(), jTextField3.getText().toString(),
                                 jTextField2.getText().toString(), mutualiste, jTextArea1.getText().toString());
                  String message = "Le produit a été ajouté à la base de données.";
                  JOptionPane.showMessageDialog(null, message);
                  sdb.CloseDB();
            }
     
            this.jTextArea1.setText(null);
            this.jTextField3.setText(null);
            this.jTextField4.setText(null);
            this.jTextField6.setText(null);
            this.jTextField5.setText(null);
            this.jTextField2.setText(null);
        }
     
        public void jButton1_actionPerformed(ActionEvent actionEvent) {
            this.setVisible(false);
            Home layout2 = new Home();
            layout2.setVisible(true);
        }
    }
     
     
    class Ajouter_jButton1_actionAdapter implements ActionListener {
        private Ajouter adaptee;
        Ajouter_jButton1_actionAdapter(Ajouter adaptee) {
            this.adaptee = adaptee;
        }
     
        public void actionPerformed(ActionEvent actionEvent) {
            adaptee.jButton1_actionPerformed(actionEvent);
        }
    }
     
     
    class Ajouter_jButton3_actionAdapter implements ActionListener {
        private Ajouter adaptee;
        Ajouter_jButton3_actionAdapter(Ajouter adaptee) {
            this.adaptee = adaptee;
        }
     
        public void actionPerformed(ActionEvent actionEvent) {
            adaptee.jButton3_actionPerformed(actionEvent);
        }
    }
     
     
    class Ajouter_jButton2_actionAdapter implements ActionListener {
        private Ajouter adaptee;
        Ajouter_jButton2_actionAdapter(Ajouter adaptee) {
            this.adaptee = adaptee;
        }
     
        public void actionPerformed(ActionEvent actionEvent) {
            adaptee.jButton2_actionPerformed(actionEvent);
        }
    }
     
     
    class Ajouter_jRadioButton1_actionAdapter implements ActionListener {
        private Ajouter adaptee;
        Ajouter_jRadioButton1_actionAdapter(Ajouter adaptee) {
            this.adaptee = adaptee;
        }
     
        public void actionPerformed(ActionEvent actionEvent) {
            adaptee.jRadioButton1_actionPerformed(actionEvent);
        }
    }
    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
    package medisoft;
     
     
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.sql.ResultSetMetaData;
    import javax.swing.JOptionPane;
     
    public class PatientDB {
     
      public Connection myCon=null;
     
      public PatientDB() {
     
         String DRIVER = "com.borland.datastore.jdbc.DataStoreDriver";
         String URL = "jdbc:borland:dslocal:";
         String FILE = "database/PATIENT.jds";
     
         try {
           Class.forName(DRIVER);
           myCon = DriverManager.getConnection(URL + FILE, "Mehdi", " ");
         }
         catch (Exception e) {
     
           System.out.println(e);
         }
      }
     
      public boolean AddPatient(String name, String cin, String gender,
                              String address, String phone, String traitant, String mutualiste,
                              String antecedants) {
     
        ResultSet r = null;
     
        try {
          Statement s = myCon.createStatement();
          r = s.executeQuery("Select * from patient where CIN='" + cin +"'");
     
          if ( (r.next())) {
            String message = "Le patient existe déjà dans la base données, Veuillez changer le numéro de la carte nationale";
            JOptionPane.showMessageDialog(null, message);
            return false;
          }
          else {
            try {
              this.myCon.createStatement().execute("insert into PATIENT values ('" + name + "','" + cin + "','" + gender + "','" +
                                                   address + "','" + phone + "','" + traitant + "','" + mutualiste + "','" + antecedants +"')");
            }
            catch (SQLException ex) {
              return false;
            }
            return true;
          }
        }
        catch (SQLException ex) {
          System.err.println("" + ex);
        }
        return false;
     }
     
      public ResultSet Search(String name) {
        ResultSet r=null;
        try {
     
          Statement s = this.myCon.createStatement();
          r = s.executeQuery("Select * from PATIENT where NOM= '" + name + "'");
        }
        catch (SQLException ex) {
          return null;
        }
     return r;
     }
     
     
        public boolean Delete_Name(String name) {
          ResultSet r = null;
     
          try {
            Statement s = this.myCon.createStatement();
            r = s.executeQuery("Select * from PATIENT where \"LAST_NAME\"='" + name +
                               "'");
            if (! (r.next())) {
              return false;
            }
            else {
              try {
                this.myCon.createStatement().execute(
                    "delete from PATIENT where \"LAST_NAME\"='" + name + "'");
              }
              catch (SQLException ex) {
                return false;
              }
              return true;
     
            }
          }
          catch (SQLException ex) {
            System.err.println("" + ex);
          }
          return false;
        }
     
    public  ResultSet ViewAll() {
      ResultSet r= null;
    try{
        Statement s = this.myCon.createStatement();
        r = s.executeQuery("Select * from PATIENT");
         ResultSetMetaData rs = r.getMetaData();
     
      }
      catch (SQLException ex) {
     
        return null;
      }
     
    return r;
    }
     
        public void CloseDB() {
            try {
              this.myCon.close();
            }
            catch (SQLException ex) {
              ex.printStackTrace();
            }
        }
        private void jbInit() throws Exception {
        }
    }
    Je ne suis pas trop experte en Java alors je ne sais pas trop comment resoudre ce probleme

    Merci beaucoup d'avance

  2. #2
    Membre éprouvé
    Profil pro
    Inscrit en
    Octobre 2004
    Messages
    142
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2004
    Messages : 142
    Par défaut
    Le problème vient de la ligne 39 de la classe PatientDB.

    Pourrai tu nous dire à quoi correspond la ligne 39 ?

    D'instinct, je dirai que ta connection est nulle...

  3. #3
    Candidat au Club
    Inscrit en
    Décembre 2008
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Décembre 2008
    Messages : 2
    Par défaut
    Citation Envoyé par DeathMaker Voir le message
    Le problème vient de la ligne 39 de la classe PatientDB.

    Pourrai tu nous dire à quoi correspond la ligne 39 ?

    D'instinct, je dirai que ta connection est nulle...
    Statement s = this.myCon.createStatement();
    r = s.executeQuery("Select * from patient where CIN='" + cin +"'");
    }

    Statement s = this.myCon.createStatement(); Voila la ligne 39

    J'ai pas compris... Comment ca ma connexion?

  4. #4
    Membre éclairé Avatar de Balbuzard
    Profil pro
    Inscrit en
    Août 2008
    Messages
    381
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France

    Informations forums :
    Inscription : Août 2008
    Messages : 381
    Par défaut
    Salut !

    Apparemment, tu as bien instancié ta connexion myCon. Donc s'il te renvoie une erreur, je dirais que c'est l'objet avec lequel tu l'as instancié qui n'est pas lui-même correctement instancié.

    C'est le Driver que tu as instancié par l'instruction Class.forName(DRIVER);

    Essaie plutôt Class.forName(DRIVER).newInstance();

    histoire de voir ce que ça donne

    bon courage ;-)

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    45
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2007
    Messages : 45
    Par défaut
    Merci, j'ai appris quelque chose

Discussions similaires

  1. Réponses: 4
    Dernier message: 08/02/2010, 08h23
  2. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException ?
    Par freezerhm dans le forum Concurrence et multi-thread
    Réponses: 5
    Dernier message: 04/12/2007, 09h26
  3. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    Par Trint dans le forum Interfaces Graphiques en Java
    Réponses: 6
    Dernier message: 27/02/2007, 11h28
  4. Réponses: 8
    Dernier message: 11/05/2006, 19h32
  5. [JDIC]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    Par kedare dans le forum Concurrence et multi-thread
    Réponses: 4
    Dernier message: 06/05/2006, 22h45

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