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 :

NetBeans ne m'affiche pas le contenu de ma table : problème ODBC


Sujet :

JDBC Java

  1. #261
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 711
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 711
    Points : 4 797
    Points
    4 797
    Par défaut
    il faut vérifier deleteCharge
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

  2. #262
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    Bingo !
    C'était encore ce fameux execSql

    Tout fonctionne dans cet onglet et les erreurs que NB me ressort sont transparente pour un utilisateur... (c'est du genre cliquer sur modifier alors qu'aucun item est sélectionné).

    Nous avons donc la certitude que l'interaction BDD <> Appli fonctionne correctement.

    On s'attaque à la création de l'annexe.
    Tu aurais des suggestions ?

  3. #263
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 711
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 711
    Points : 4 797
    Points
    4 797
    Par défaut
    Citation Envoyé par Spiicky Voir le message
    On s'attaque à la création de l'annexe. Tu aurais des suggestions ?
    aucune ... pour le moment, j'attends les bugs !
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

  4. #264
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    Dans le but de créer une annexe, je passe par cette étape :
    Nom : Sans titre.jpg
Affichages : 299
Taille : 189,8 Ko

    Puis je valide pour effectivement créer l'annexe et j'ai l'erreur suivante :
    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
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'TypeCC' in 'field list'
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
            at com.mysql.jdbc.Util.getInstance(Util.java:408)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
            at com.mysql.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1540)
            at com.mysql.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2595)
            at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1468)
            at coactivite2.Connexion.execSql(Connexion.java:61)
            at coactivite2.Fenetre.jButtonValiderAjoutAnnexeOuiActionPerformed(Fenetre.java:6709)
            at coactivite2.Fenetre.access$5300(Fenetre.java:30)
            at coactivite2.Fenetre$55.actionPerformed(Fenetre.java:3574)
    On se penche sur jButtonValiderAjoutAnnexeOuiActionPerformed (ATTENTION les yeux ):
    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
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
     
    private void jButtonValiderAjoutAnnexeOuiActionPerformed(java.awt.event.ActionEvent evt) {                                                             
            try
            {
                /* Récupération des informations de l'onglet "Informations Générales" */
                Annexe annexe = new Annexe();
                annexe.setIdAnnexe(Integer.parseInt(jTextFieldNumAnnexe.getText()));
                if(jFormattedTextFieldDateCreation.getText().matches("\\d\\d/\\d\\d/\\d\\d\\d\\d"))
                {
                    annexe.setDateCreation(jFormattedTextFieldDateCreation.getText());
                }
                else
                {
                    System.out.println(annexe.getDateCreation());
                }
     
                if(jFormattedTextFieldDateDeb.getText().matches("\\d\\d/\\d\\d/\\d\\d\\d\\d"))
                {
                    annexe.setDateDeb(jFormattedTextFieldDateDeb.getText());
                }
                else
                {
                    annexe.setDateDeb("01/01/1936");
                    System.out.println(annexe.getDateDeb());
                }
     
                if(jFormattedTextFieldDateFin.getText().matches("\\d\\d/\\d\\d/\\d\\d\\d\\d"))
                {
                    annexe.setDateFin(jFormattedTextFieldDateFin.getText());
                }
                else
                {
                    annexe.setDateFin("01/01/1936");
                    System.out.println(annexe.getDateFin());
                }
     
                annexe.setMatricule(System.getProperty("user.name"));
                ChargeAffaire charge = new ChargeAffaire();
                charge.setMatricule(System.getProperty("user.name"));
                if(jTextFieldTelephoneCharge.getText().isEmpty()==false)
                {
                    charge.setTel(jTextFieldTelephoneCharge.getText());
                }
     
                /* Récupération de l'Id du chef de chantier dela société principale */
                ChefChantier chefPrincipal = new ChefChantier();
                try
                {
                    chefPrincipal.setIdCC(ChefChantier.recupererIdCC(jComboBoxCC, jComboBoxSociete));
                }
                catch(Exception e)
                {
                    chefPrincipal.setIdCC(0);
                }
     
                /* Insertion dans la table Realiser */
                try{
                    Connexion connexion = new Connexion();
                    connexion.execSql("INSERT INTO Realiser (IdCC, IdAnnexe, TypeCC) VALUES ("+chefPrincipal.getIdCC()+", "+annexe.getIdAnnexe()+", 'Principal');");
                    connexion.closeConn();
                } catch (Exception e) {
                    e.printStackTrace();
                }
     
                /* Récupération des informations de l'onglet "Intervention" */
                if(jTextFieldEffectif.getText().isEmpty()==false)
                {
                    annexe.setEffectif(Integer.parseInt(jTextFieldEffectif.getText()));
                }
     
                annexe.setNatureIntervention(jTextAreaNatureIntervention.getText());
     
                /* Récupération de l'Id de l'installation */
                Installation install = new Installation();
                try
                {
                    Connexion connexion = new Connexion();
                    ResultSet resultats = connexion.getResultSet("SELECT IdInstallation FROM Installation WHERE NomInstallation = '"+(String)jComboBoxInstallation.getSelectedItem()+"';");
                    while(resultats.next())
                    {
                        install.setIdInstallation(resultats.getInt(1));
                    }
                    resultats.close();
                    connexion.closeConn();
                }
                catch(Exception e)
                {
                    System.out.println(e.getMessage());
                    e.printStackTrace();
                }
     
                /* Récupération de l'Id de la zone */
                Zone zone = new Zone();
                try
                {
                    Connexion connexion = new Connexion();
                    ResultSet resultats = connexion.getResultSet("SELECT IdZone FROM Zone WHERE NomZone = '"+(String)jComboBoxZone.getSelectedItem()+"'AND IdInstallation = "+install.getIdInstallation()+";");
                    while(resultats.next())
                    {
                        annexe.setIdZone(resultats.getInt(1));
                    }
                    resultats.close();
                    connexion.closeConn();
                }
                catch(SQLException e)
                {
                    System.out.println(e.getMessage());
                    e.printStackTrace();
                }
     
                try
                {
                    Mail mail = new Mail();
                    mail.envoyer(annexe, charge);
                    mail.envoyerCharge(annexe, charge);
                }
                catch(SQLException e)
                {
                    System.out.println(e.getMessage());
                }
     
                /* Insertion dans la table Annexe */
                try
                {
                    Connexion connexion = new Connexion();
                    connexion.execSql("UPDATE Annexe SET NatureIntervention = '"+annexe.getNatureIntervention().replace("'", "''")+"', DateCreation = '"+annexe.getDateCreation()+"', DateDeb = '"+annexe.getDateDeb()+"', DateFin = '"+annexe.getDateFin()+"', Effectif = "+annexe.getEffectif()+", Upload = "+annexe.getUpload()+", Matricule = '"+annexe.getMatricule()+"', IdZone = "+annexe.getIdZone()+" WHERE IdAnnexe = "+annexe.getIdAnnexe()+";");
                    connexion.closeConn();
                }
                catch(Exception e)
                {
                    System.out.println("Fenetre : Erreur update Annexe! "+e.getMessage());
                    e.printStackTrace();
                }
     
                /* Récupération et insertion dans la base des plages horaires */
                if (jRadioButton614.isSelected() == true)
                {
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Avoir VALUES ("+annexe.getIdAnnexe()+", "+1+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                if (jRadioButton1422.isSelected() == true)
                {
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Avoir VALUES ("+annexe.getIdAnnexe()+", "+2+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                if (jRadioButton716.isSelected() == true)
                {
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Avoir VALUES ("+annexe.getIdAnnexe()+", "+3+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                if (jRadioButtonWeek.isSelected() == true)
                {
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Avoir VALUES ("+annexe.getIdAnnexe()+", "+4+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                if (jRadioButtonNuit.isSelected() == true)
                {
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Avoir VALUES ("+annexe.getIdAnnexe()+", "+5+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                /* Insertion dans la table Autorisation */
                if(jRadioButtonVehiculeOui.isSelected())
                {
                    Autorisation vehicule = new Autorisation();
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Autorisation (TypeAutorisation, IdAnnexe) VALUES ('Véhicule', "+annexe.getIdAnnexe()+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                if(jRadioButtonConsignationOui.isSelected())
                {
                    Autorisation consignation = new Autorisation();
                    consignation.setDateDebAutorisation(jTextFieldDelivrerConsignation.getText());
                    consignation.setDateFinAutorisation(jTextFieldValiditeConsignation.getText());
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Autorisation (TypeAutorisation, DateDebAutorisation, DateFinAutorisation, IdAnnexe) VALUES ('Consignation', '"+consignation.getDateDebAutorisation()+"', '"+consignation.getDateFinAutorisation()+"', "+annexe.getIdAnnexe()+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                if(jRadioButtonFeuOui.isSelected())
                {
                    Autorisation feu = new Autorisation();
                    feu.setDateDebAutorisation(jTextFieldDelivrerFeu.getText());
                    feu.setDateFinAutorisation(jTextFieldValiditeFeu.getText());
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Autorisation (TypeAutorisation, DateDebAutorisation, DateFinAutorisation, IdAnnexe) VALUES ('Feu', '"+feu.getDateDebAutorisation()+"', '"+feu.getDateFinAutorisation()+"', "+annexe.getIdAnnexe()+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                /*if(jLabelEtatConsignation.getText().equalsIgnoreCase("Autorisation accordée"))
                {
                    Autorisation consignation = new Autorisation();
                    consignation.setDateDebAutorisation(jFormattedTextFieldDateDebConsignation.getText());
                    consignation.setDateFinAutorisation(jFormattedTextFieldDateFinConsignation.getText());
                    try
                    {
                        Connexion.query = "INSERT INTO Autorisation (TypeAutorisation, DateDebAutorisation, DateFinAutorisation, IdAnnexe) VALUES ('Consignation', '"+consignation.getDateDebAutorisation()+"', '"+consignation.getDateFinAutorisation()+"', "+annexe.getIdAnnexe()+");";
                        Connexion.stmt.executeUpdate(Connexion.query);
                    }
                    catch(SQLException e)
                    {
                        System.out.println(e.getMessage());
                    }
                }
     
                if(jLabelEtatVehicule.getText().equalsIgnoreCase("Autorisation accordée"))
                {
                    Autorisation vehicule = new Autorisation();
                    vehicule.setDateDebAutorisation(jFormattedTextFieldDateDebVehicule.getText());
                    vehicule.setDateFinAutorisation(jFormattedTextFieldDateFinVehicule.getText());
                    try
                    {
                        Connexion.query = "INSERT INTO Autorisation (TypeAutorisation, DateDebAutorisation, DateFinAutorisation, IdAnnexe) VALUES ('Véhicule', '"+vehicule.getDateDebAutorisation()+"', '"+vehicule.getDateFinAutorisation()+"', "+annexe.getIdAnnexe()+");";
                        Connexion.stmt.executeUpdate(Connexion.query);
                    }
                    catch(SQLException e)
                    {
                        System.out.println(e.getMessage());
                    }
                }
     
                if(jLabelEtatFeu.getText().equalsIgnoreCase("Autorisation accordée"))
                {
                    Autorisation feu = new Autorisation();
                    feu.setDateDebAutorisation(jFormattedTextFieldDateDebFeu.getText());
                    feu.setDateFinAutorisation(jFormattedTextFieldDateFinFeu.getText());
                    try
                    {
                        Connexion.query = "INSERT INTO Autorisation (TypeAutorisation, DateDebAutorisation, DateFinAutorisation, IdAnnexe) VALUES ('Feu', '"+feu.getDateDebAutorisation()+"', '"+feu.getDateFinAutorisation()+"', "+annexe.getIdAnnexe()+");";
                        Connexion.stmt.executeUpdate(Connexion.query);
                    }
                    catch(SQLException e)
                    {
                        System.out.println(e.getMessage());
                    }
                }*/
     
                /* Récupération des risques et préventions */
                Risque risque1 = new Risque();
                Risque risque2 = new Risque();
                Risque risque3 = new Risque();
                risque1.setLibelleRisque(jTextFieldRisque1.getText());
                risque2.setLibelleRisque(jTextFieldRisque2.getText());
                risque3.setLibelleRisque(jTextFieldRisque3.getText());
                risque1.setPrevention(jTextFieldPrevention1.getText());
                risque2.setPrevention(jTextFieldPrevention2.getText());
                risque3.setPrevention(jTextFieldPrevention3.getText());
     
                /* Insertion dans la table Risque */
                if(risque1.getLibelleRisque().length() != 0)
                {
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Risque (LibelleRisque, Prevention, IdAnnexe) VALUES ('"+risque1.getLibelleRisque()+"', '"+risque1.getPrevention()+"', "+annexe.getIdAnnexe()+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                if(risque2.getLibelleRisque().length() != 0)
                {
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Risque (LibelleRisque, Prevention, IdAnnexe) VALUES ('"+risque2.getLibelleRisque()+"', '"+risque2.getPrevention()+"', "+annexe.getIdAnnexe()+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                if(risque3.getLibelleRisque().length() != 0)
                {
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Risque (LibelleRisque, Prevention, IdAnnexe) VALUES ('"+risque3.getLibelleRisque()+"', '"+risque3.getPrevention()+"', "+annexe.getIdAnnexe()+");");
                        connexion.closeConn();
                    }
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
                /* Récupération des sous traitants */
                for(int i = 0; i < jTableST.getRowCount(); i++)
                {
                    int idCC = ChefChantier.recupererIdCCST(jTableST, i);
                    Societe st = new Societe();
                    try
                    {
                        Connexion connexion = new Connexion();
                        ResultSet resultats = connexion.getResultSet("SELECT IdSociete FROM Societe WHERE NomSociete = '"+jTableST.getValueAt(i, 0)+"' AND ActiviteSociete = '"+jTableST.getValueAt(i, 1)+"';");
                        while(resultats.next())
                        {
                            st.setIdSociete(resultats.getInt(1));
                        }
                        resultats.close();
                        connexion.closeConn();
                    }
     
                    catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        st.setIdSociete(0);
                        e.printStackTrace();
                    }
     
                    try
                    {
                        Connexion connexion = new Connexion();
                        connexion.execSql("INSERT INTO Realiser (IdCC, IdAnnexe, TypeCC) VALUES ("+idCC+", "+annexe.getIdAnnexe()+", 'Sous-Traitant');");
                        connexion.closeConn();
                    } catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }
                }
     
            /* Génération de l'annexe sous Excel */
            try
            {
                FichierExcel excel = new FichierExcel(jTextFieldNumAnnexe.getText());
                excel.sousTraitant(jTableST);
                excel.risque(risque1, risque2, risque3);
                excel.effectif(jTextFieldEffectif.getText());
                excel.chargeAffaire(jTextFieldChargeAffaire.getText());
                try
                {
                    excel.societe(jComboBoxSociete.getSelectedItem().toString());
                }
                catch(Exception e)
                {
                    excel.societe("");
                }
                if(annexe.getDateFin().toString().equals((String)"01/01/1936"))
                {
                    excel.validite("");
                }
                else
                {
                    excel.validite(annexe.getDateFin());
                }
                excel.telCharge(charge.getTel());
                String inst;
                String zo;
                try
                {
                    inst = jComboBoxInstallation.getSelectedItem().toString();
                }
                catch(Exception e)
                {
                    inst = "";
                }
                try
                {
                    zo = jComboBoxZone.getSelectedItem().toString();
                }
                 catch(Exception e)
                {
                    zo = "";
                }
                excel.lieu(inst, zo);
                excel.intervention(annexe.getNatureIntervention());
                if(annexe.getDateDeb().toString().equals((String)"01/01/1936"))
                {
                    excel.dateDebut("");
                }
                else
                {
                    excel.dateDebut(annexe.getDateDeb());
                }
                excel.vehicule(jRadioButtonVehiculeOui);
                excel.feu(jRadioButtonFeuOui, jTextFieldDelivrerFeu.getText(), jTextFieldValiditeFeu.getText());
                excel.consignation(jRadioButtonConsignationOui, jTextFieldDelivrerConsignation.getText(), jTextFieldValiditeConsignation.getText());
                excel.horaire(jRadioButton614.isSelected(), jRadioButton1422.isSelected(), jRadioButton716.isSelected(), jRadioButtonWeek.isSelected(), jRadioButtonNuit.isSelected());
                try
                {
                    excel.coordonneesSP(jComboBoxSociete.getSelectedItem().toString());
                }
                catch(Exception e)
                {
                    excel.coordonneesSP(null);
                    e.printStackTrace();
                }
                excel.fonctionCharge(annexe.getMatricule());
                System.out.println("test before");
                System.out.println("CC : "+ChefChantier.recupererIdCC(jComboBoxCC, jComboBoxSociete));
                excel.cCPrincipal(ChefChantier.recupererIdCC(jComboBoxCC, jComboBoxSociete));
                excel.sousTraitant2(jTableST);
                excel.coordonneesST(jTableST);
                excel.fermer();
                excel.ouvrir(jTextFieldNumAnnexe.getText());
            }
            catch(Exception e)
            {
               System.out.println(e.getMessage());
               e.printStackTrace();
            }
    ps : si tu vois des infos sensibles que j'aurais zappées , hésites pas à les supprimer stp

  5. #265
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 711
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 711
    Points : 4 797
    Points
    4 797
    Par défaut
    Tu devrais pourtant savoir une stackTrace() d'erreur maintenant !!!
    C'est écrit en toutes lettres sur la 1ère ligne :
    MySQLSyntaxErrorException: Unknown column 'TypeCC' in 'field list'
    MySql râle car tu essayes d'écrire dans une colonne TypeCC qui n'existe pas dans la table Realiser

    voir :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    INSERT INTO Realiser (IdCC, IdAnnexe, TypeCC) VALUES
    Cette colonne devait exister dans Access mais n'a pas été transmise dans MySql
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

  6. #266
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    Oula mea culpa
    Je ferais plus attention par la suite ! Promis

    j'ai vérifié et ce champ n'existait pas auparavant, c'est étonnant !
    Mais bon, je vais le créer dans WorkBench pour test...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    ALTER TABLE realiser
    ADD TypeCC varchar(20)

  7. #267
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    Ah! On arrive aux problèmes de date !
    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
    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 '' at line 1
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
            at com.mysql.jdbc.Util.getInstance(Util.java:408)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
            at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1369)
            at coactivite2.Connexion.getResultSet(Connexion.java:50)
            at coactivite2.Mail.envoyer(Mail.java:89)
    Mail.envoyer():
    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
    /* Fonction effectuant l'envoi du mail */
        @SuppressWarnings("static-access")
        public void envoyer(Annexe annexe, ChargeAffaire charge) throws MessagingException, SQLException
        {
            try
            {
                this.setServeur();
                Connexion connexion = new Connexion();
                ResultSet resultats = connexion.getResultSet("SELECT MailCharge FROM ChargeAffaire WHERE Matricule = '"+charge.getMatricule()+"';");
                while(resultats.next())
                {
                    mailExpediteur = resultats.getString(1);
                }
                resultats.close();
    
                resultats = connexion.getResultSet("SELECT NomCharge, PrenomCharge FROM ChargeAffaire WHERE Matricule = '"+charge.getMatricule()+"'");
                while(resultats.next())
                {
                    charge.setNom(resultats.getString(1));
                    charge.setPrenom(resultats.getString(2));
                }
                resultats.close();
                System.out.println(annexe.getDateDeb());
    
                resultats = connexion.getResultSet("SELECT MailCharge, IdAnnexe, NomInstallation, NomZone, DateDeb, DateFin FROM ChargeAffaire, Annexe, Zone, Installation WHERE Annexe.IdZone = "+annexe.getIdZone()+" AND ChargeAffaire.Matricule = Annexe.Matricule AND Zone.IdZone = Annexe.IdZone AND Zone.IdInstallation = Installation.IdInstallation AND (#"+Utilitaire.formaterDateRequete(Utilitaire.stringToDate(annexe.getDateDeb()))+"# BETWEEN DateDeb AND DateFin OR #"+Utilitaire.formaterDateRequete(Utilitaire.stringToDate(annexe.getDateFin()))+"# BETWEEN DateDeb AND DateFin);");
                while(resultats.next())
                {
                    mailRecepteur = resultats.getString(1);
                    this.setSujet("Risque de co-activité pour l'annexe n°"+resultats.getInt(2));
                    this.setTexte("L'annexe n°"+resultats.getInt(2)+" se trouvant à l'installation : "+resultats.getString(3)+" et dans la zone : "+resultats.getString(4)+" et ayant lieu entre le "+Utilitaire.formaterDate(resultats.getDate(5))+" et le "+Utilitaire.formaterDate(resultats.getDate(6))+" comporte un risque de co-activité avec l'annexe "+annexe.getIdAnnexe()+" ("+ annexe.getNatureIntervention()+"). Veuillez contacter votre responsable afin de prendre les mesures nécessaires.");
                    message.setFrom(new InternetAddress(mailExpediteur));
                    message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailRecepteur));
                    Transport.send(message);
                }
                resultats.close();
                connexion.closeConn();
            }
            catch(Exception e)
            {
                System.out.println("erreur : "+e.getMessage());
                e.printStackTrace();
            }
        }
    Je sais pas trop par où commencer là, c'est cette ligne qui pose probleme :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Utilitaire.formaterDateRequete(Utilitaire.stringToDate(annexe.getDateDeb()))
    Je pense commencer par ce qui est de plus encapsulé non ? (à savoir getDateDeb())

  8. #268
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 711
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 711
    Points : 4 797
    Points
    4 797
    Par défaut
    Quand tu as une requête qui n'en fini pas, il vaut mieux la stocker dans une variable, comme cela tu l'imprimes et tu vois où ça coince
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    String sql = "SELECT MailCharge, IdAnnexe, NomInstallation, NomZone, DateDeb, DateFin FROM ChargeAffaire, Annexe, Zone, Installation WHERE Annexe.IdZone = "+annexe.getIdZone()+" AND ChargeAffaire.Matricule = Annexe.Matricule AND Zone.IdZone = Annexe.IdZone AND Zone.IdInstallation = Installation.IdInstallation AND (#"+Utilitaire.formaterDateRequete(Utilitaire.stringToDate(annexe.getDateDeb()))+"# BETWEEN DateDeb AND DateFin OR #"+Utilitaire.formaterDateRequete(Utilitaire.stringToDate(annexe.getDateFin()))+"# BETWEEN DateDeb AND DateFin);"
    System.out.println(sql);
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

  9. #269
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    Bon, je te fais une impression de toutes les erreurs :
    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
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    run:
    Thu Nov 03 15:13:23 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:23 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:23 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:23 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:23 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:23 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:23 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:23 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:23 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:23 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:24 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:24 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:24 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:24 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:24 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Annexe : Erreur lors de l'affichage du tableau Upload! null
    java.lang.NullPointerException
            at java.util.Calendar.setTime(Calendar.java:1075)
            at java.text.SimpleDateFormat.format(SimpleDateFormat.java:876)
            at java.text.SimpleDateFormat.format(SimpleDateFormat.java:869)
            at java.text.DateFormat.format(DateFormat.java:316)
            at coactivite2.Utilitaire.formaterDate(Utilitaire.java:65)
            at coactivite2.Annexe.AffichageUpload(Annexe.java:318)
            at coactivite2.Fenetre.MenuOngletFocusGained(Fenetre.java:6238)
            at coactivite2.Fenetre.access$6000(Fenetre.java:30)
            at coactivite2.Fenetre$62.focusGained(Fenetre.java:3927)
            at java.awt.AWTEventMulticaster.focusGained(AWTEventMulticaster.java:203)
            at java.awt.Component.processFocusEvent(Component.java:6177)
            at java.awt.Component.processEvent(Component.java:6044)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
            at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:901)
            at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:513)
            at java.awt.Component.dispatchEventImpl(Component.java:4523)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.SequencedEvent.dispatch(SequencedEvent.java:101)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Thu Nov 03 15:13:29 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:29 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:29 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:29 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:29 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:29 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:29 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Annexe : Erreur lors de l'affichage du tableau Upload! null
    java.lang.NullPointerException
            at java.util.Calendar.setTime(Calendar.java:1075)
            at java.text.SimpleDateFormat.format(SimpleDateFormat.java:876)
            at java.text.SimpleDateFormat.format(SimpleDateFormat.java:869)
            at java.text.DateFormat.format(DateFormat.java:316)
            at coactivite2.Utilitaire.formaterDate(Utilitaire.java:65)
            at coactivite2.Annexe.AffichageUpload(Annexe.java:318)
            at coactivite2.Fenetre.MenuOngletFocusGained(Fenetre.java:6238)
            at coactivite2.Fenetre.access$6000(Fenetre.java:30)
            at coactivite2.Fenetre$62.focusGained(Fenetre.java:3927)
            at java.awt.AWTEventMulticaster.focusGained(AWTEventMulticaster.java:203)
            at java.awt.Component.processFocusEvent(Component.java:6177)
            at java.awt.Component.processEvent(Component.java:6044)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
            at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:901)
            at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:513)
            at java.awt.Component.dispatchEventImpl(Component.java:4523)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.SequencedEvent.dispatch(SequencedEvent.java:101)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Thu Nov 03 15:13:30 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:31 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:33 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:33 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:34 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:35 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:36 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    null
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    03/11/2016
    Thu Nov 03 00:00:00 CET 2016
    Thu Nov 03 00:00:00 CET 2016
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    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 '' at line 1
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
            at com.mysql.jdbc.Util.getInstance(Util.java:408)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
            at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1369)
            at coactivite2.Connexion.getResultSet(Connexion.java:50)
            at coactivite2.Mail.envoyer(Mail.java:89)
            at coactivite2.Fenetre.jButtonValiderAjoutAnnexeOuiActionPerformed(Fenetre.java:6764)
            at coactivite2.Fenetre.access$5300(Fenetre.java:30)
            at coactivite2.Fenetre$55.actionPerformed(Fenetre.java:3574)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
            at java.awt.Dialog$1.run(Dialog.java:1046)
            at java.awt.Dialog$3.run(Dialog.java:1098)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Dialog.show(Dialog.java:1096)
            at java.awt.Component.show(Component.java:1584)
            at java.awt.Component.setVisible(Component.java:1536)
            at java.awt.Window.setVisible(Window.java:842)
            at java.awt.Dialog.setVisible(Dialog.java:986)
            at coactivite2.Fenetre.jButtonCreerAnnexeActionPerformed(Fenetre.java:5542)
            at coactivite2.Fenetre.access$7500(Fenetre.java:30)
            at coactivite2.Fenetre$74.actionPerformed(Fenetre.java:4635)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Thu Nov 03 00:00:00 CET 2016
    java.lang.NullPointerException
            at coactivite2.Mail.envoyer(Mail.java:92)
            at coactivite2.Fenetre.jButtonValiderAjoutAnnexeOuiActionPerformed(Thu Nov 03 00:00:00 CET 2016
    Fenetre.java:6764)
            at coactivite2.Fenetre.access$5300(Fenetre.java:30)
            at coactivite2.Fenetre$55.actionPerformed(Fenetre.java:3574)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    AHHHHHHHHHHHHHHHHHHHHHHHSELECT MailCharge, IdAnnexe, NomInstallation, NomZone, DateDeb, DateFin FROM ChargeAffaire, Annexe, Zone, Installation WHERE Annexe.IdZone = 75 AND ChargeAffaire.Matricule = Annexe.Matricule AND Zone.IdZone = Annexe.IdZone AND Zone.IdInstallation = Installation.IdInstallation AND (#11/03/2016# BETWEEN DateDeb AND DateFin OR #11/03/2016# BETWEEN DateDeb AND DateFin);
    erreur : null
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
            at java.awt.Dialog$1.run(Dialog.java:1046)
            at java.awt.Dialog$3.run(Dialog.java:1098)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Dialog.show(Dialog.java:1096)
            at java.awt.Component.show(Component.java:1584)
            at java.awt.Component.setVisible(Component.java:1536)
            at java.awt.Window.setVisible(Window.java:842)
            at java.awt.Dialog.setVisible(Dialog.java:986)
            at coactivite2.Fenetre.jButtonCreerAnnexeActionPerformed(Fenetre.java:5542)
            at coactivite2.Fenetre.access$7500(Fenetre.java:30)
            at coactivite2.Fenetre$74.actionPerformed(Fenetre.java:4635)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    null
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 00:00:00 CET 2016
    Thu Nov 03 00:00:00 CET 2016
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    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 '' at line 1
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
            at com.mysql.jdbc.Util.getInstance(Util.java:408)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
            at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1369)
            at coactivite2.Connexion.getResultSet(Connexion.java:50)
            at coactivite2.Mail.envoyerCharge(Mail.java:132)
            at coactivite2.Fenetre.jButtonValiderAjoutAnnexeOuiActionPerformed(Fenetre.java:6765)
            at coactivite2.Fenetre.access$5300(Fenetre.java:30)
            at coactivite2.Fenetre$55.actionPerformed(Fenetre.java:3574)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
            at java.awt.Dialog$1.run(Dialog.java:1046)
            at java.awt.Dialog$3.run(Dialog.java:1098)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Dialog.show(Dialog.java:1096)
            at java.awt.Component.show(Component.java:1584)
            at java.awt.Component.setVisible(Component.java:1536)
            at java.awt.Window.setVisible(Window.java:842)
            at java.awt.Dialog.setVisible(Dialog.java:986)
            at coactivite2.Fenetre.jButtonCreerAnnexeActionPerformed(Fenetre.java:5542)
            at coactivite2.Fenetre.access$7500(Fenetre.java:30)
            at coactivite2.Fenetre$74.actionPerformed(Fenetre.java:4635)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    java.lang.NullPointerException
            at coactivite2.Mail.envoyerCharge(Mail.java:133)
            at coactivite2.Fenetre.jButtonValiderAjoutAnnexeOuiActionPerformed(Fenetre.java:6765)
            at coactivite2.Fenetre.access$5300(Fenetre.java:30)
            at coactivite2.Fenetre$55.actionPerformed(Fenetre.java:3574)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
            at java.awt.Dialog$1.run(Dialog.java:1046)
            at java.awt.Dialog$3.run(Dialog.java:1098)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Dialog.show(Dialog.java:1096)
            at java.awt.Component.show(Component.java:1584)
            at java.awt.Component.setVisible(Component.java:1536)
            at java.awt.Window.setVisible(Window.java:842)
            at java.awt.Dialog.setVisible(Dialog.java:986)
            at coactivite2.Fenetre.jButtonCreerAnnexeActionPerformed(Fenetre.java:5542)
            at coactivite2.Fenetre.access$7500(Fenetre.java:30)
            at coactivite2.Fenetre$74.actionPerformed(Fenetre.java:4635)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect date value: '03/11/2016' for column 'DateCreation' at row 1
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3968)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
            at com.mysql.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1540)
            at com.mysql.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2595)
            at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1468)
            at coactivite2.Connexion.execSql(Connexion.java:61)
            at coactivite2.Fenetre.jButtonValiderAjoutAnnexeOuiActionPerformed(Fenetre.java:6776)
            at coactivite2.Fenetre.access$5300(Fenetre.java:30)
            at coactivite2.Fenetre$55.actionPerformed(Fenetre.java:3574)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
            at java.awt.Dialog$1.run(Dialog.java:1046)
            at java.awt.Dialog$3.run(Dialog.java:1098)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Dialog.show(Dialog.java:1096)
            at java.awt.Component.show(Component.java:1584)
            at java.awt.Component.setVisible(Component.java:1536)
            at java.awt.Window.setVisible(Window.java:842)
            at java.awt.Dialog.setVisible(Dialog.java:986)
            at coactivite2.Fenetre.jButtonCreerAnnexeActionPerformed(Fenetre.java:5542)
            at coactivite2.Fenetre.access$7500(Fenetre.java:30)
            at coactivite2.Fenetre$74.actionPerformed(Fenetre.java:4635)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:48 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    null
    java.lang.NullPointerException
            at coactivite2.Connexion.closeConn(Connexion.java:69)
            at coactivite2.FichierExcel.sousTraitant(FichierExcel.java:177)
            at coactivite2.Fenetre.jButtonValiderAjoutAnnexeOuiActionPerformed(Fenetre.java:7059)
            at coactivite2.Fenetre.access$5300(Fenetre.java:30)
            at coactivite2.Fenetre$55.actionPerformed(Fenetre.java:3574)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
            at java.awt.Dialog$1.run(Dialog.java:1046)
            at java.awt.Dialog$3.run(Dialog.java:1098)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Dialog.show(Dialog.java:1096)
            at java.awt.Component.show(Component.java:1584)
            at java.awt.Component.setVisible(Component.java:1536)
            at java.awt.Window.setVisible(Window.java:842)
            at java.awt.Dialog.setVisible(Dialog.java:986)
            at coactivite2.Fenetre.jButtonCreerAnnexeActionPerformed(Fenetre.java:5542)
            at coactivite2.Fenetre.access$7500(Fenetre.java:30)
            at coactivite2.Fenetre$74.actionPerformed(Fenetre.java:4635)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6288)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6053)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
            at java.awt.EventQueue$2.run(EventQueue.java:616)
            at java.awt.EventQueue$2.run(EventQueue.java:614)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Thu Nov 03 15:13:49 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:49 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:49 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:49 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:49 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:49 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:49 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:49 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Thu Nov 03 15:13:49 CET 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Mais pour notre histoire de requête qui n'en fini pas, c'est cette partie :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    SELECT MailCharge, IdAnnexe, NomInstallation, NomZone, DateDeb, DateFin FROM ChargeAffaire, Annexe, Zone, Installation WHERE Annexe.IdZone = 75 AND ChargeAffaire.Matricule = Annexe.Matricule AND Zone.IdZone = Annexe.IdZone AND Zone.IdInstallation = Installation.IdInstallation AND (#11/03/2016# BETWEEN DateDeb AND DateFin OR #11/03/2016# BETWEEN DateDeb AND DateFin);
    erreur : null
    Je pense que c'est ces dièses qui nos poses problème (Anciennement accepté par Access)
    Right ?

  10. #270
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    (ps : je dois filer, à demain ! et merci encore )

  11. #271
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 711
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 711
    Points : 4 797
    Points
    4 797
    Par défaut
    Ah oui, les # c'est uniquement dans Access
    on avait déjà traité un problème de date avec MySql. Il faut :
    - supprimer les #
    - que la fonction Utilitaire.formaterDateRequete renvoie la chaîne " STR_TO_DATE('17-09-2010','%d-%m-%Y') "
    on avait déjà vu cela précédemment
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

  12. #272
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    Me voilà de retour ! pour vous jouez un mauvais tour ! faut vraiment que j'arrête cette blague...

    Alors concernant nos petites dates, voici la fonction formaterDateRequete de base :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
        public static String formaterDateRequete(Date date)
        {
            String format = "MM/dd/yyyy";
            java.text.SimpleDateFormat formater = new java.text.SimpleDateFormat(format);
            return formater.format(date);
        }
    J'ai tenté ca sans succès:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
        public static String formaterDateRequete(Date date)
        {
            Date newFormatDate = STR_TO_DATE(date,'%Y-%m-%d');
            return newFormatDate;
        }
    Puis j'ai fini par faire ca:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    public static String formaterDateRequete(Date date)
        {
            String format = "yyyy-MM-dd";
            java.text.SimpleDateFormat formater = new java.text.SimpleDateFormat(format);
            return formater.format(date);
        }
    On va pas réinventer la roue en fait

  13. #273
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    J'aime pas faire 36 choses en même temps mais dès l'ouverture de l'appli j'ai ceci et ce m'irrite un peu
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    Annexe : Erreur lors de l'affichage du tableau Upload! null
    java.lang.NullPointerException
            at java.util.Calendar.setTime(Calendar.java:1075)
            at java.text.SimpleDateFormat.format(SimpleDateFormat.java:876)
            at java.text.SimpleDateFormat.format(SimpleDateFormat.java:869)
            at java.text.DateFormat.format(DateFormat.java:316)
            at coactivite2.Utilitaire.formaterDate(Utilitaire.java:65)
            at coactivite2.Annexe.AffichageUpload(Annexe.java:318)
            at coactivite2.Fenetre.MenuOngletFocusGained(Fenetre.java:6238)
            at coactivite2.Fenetre.access$6000(Fenetre.java:30)
            at coactivite2.Fenetre$62.focusGained(Fenetre.java:3927)
    J'ai donc été voir formaterDate:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    /* Méthode permettant de formater une date en dd/MM/aaaa pour l'affichage */
        public static String formaterDate(Date date)
        {
            String format = "yyyy-MM-dd";
            java.text.SimpleDateFormat formater = new java.text.SimpleDateFormat(format);
            return formater.format(date);
        }
    J'ai modifier le format pour avoir celui souhaité : "yyyy-MM-dd" mais j'ai la même erreur.

    J'ai aussi tenté ca :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Date newFormatDate = STR_TO_DATE(date,'%Y-%m-%d');
            return newFormatDate;
    Résultat :
    Nom : Sans titre.jpg
Affichages : 242
Taille : 57,9 Ko
    Je pense pas que ce soit un String qu'on reçoit si ?

    MODIFIED : Ah, je viens de faire la requ^te dans la BDD et elle renvoi des champs date qui sont null (due à la mauvaise insertion je pense donc on peut laisser de coté pour le moment)

  14. #274
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    La petite lumière verte à coté de ton pseudo a du mal à s'allumer ce matin Népo !

    Bon j'ai corrigé tout ce qu'il y a avant je pense.
    J'aimerais à présent modifier un format de date
    exemple :
    annexe.getDateCreation() = 04/11/2016
    J'aimerais avoir : 2016-11-04

    Je pourrais passer par une fonction substring mais je pense qu'il y a plus pro !
    Du genre (que j'arrive pas à faire fonctionner) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    String format = "MM/dd/yyyy";
                    java.text.SimpleDateFormat formater = new java.text.SimpleDateFormat(format);
                    System.out.print(formater.format(annexe.getDateCreation()));
    MODIFIED :
    Bon du coup j'ai réussis à me faire une petite fonction :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
                    String foo = annexe.getDateCreation();
                    String[] split  = foo.split("/");
                    String year     = split[2];
                    String month    = split[1];
                    String day      = split[0];
                    String joined   = year+"-"+month+"-"+day;
                    System.out.print("LADDDAAATTTEEEE:"+joined);
    Je pense qu'il y a bcp plus propre mais bon, je comprend le rudiments maintenant
    Je vais tester ca !

    ps : vu que t'es plus là, j'ai l'impression de parler à un journal intime Mdr

    MODIFIED :
    Finalement, voici ma fonction placé dans Utilitaire :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
        public static String dateToDB(String chaine)
        {
            String[] split  = chaine.split("/");
            return split[2]+"-"+split[1]+"-"+split[0];
        }
    utilisation de cette fonction :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Utilitaire.dateToDB(annexe.getDateFin())
    je suis fier de moi ... oui oui ! pour ce petit truc lol

  15. #275
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    Bon, j'ai continué mes petits test et voilà que je rencontre une erreur à ce niveau :
    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
    public static void AffichageUpload(String query, JTable table, int ida)
        {
            System.out.print(" HHHHHHHHHHHHHH ");
            try
            {
                DefaultTableModel modele = (DefaultTableModel) table.getModel();
                Vector<Vector<String>> data = null;
                Connexion connexion = new Connexion();
                ResultSet resultats = connexion.getResultSet(query);
                int i = 0;
                Utilitaire.centrerTable(table);
                System.out.print(" HHHHHHHHHHHHHH "+resultats.getDate(2));
                System.out.print("HHHHHHHHHHHHHH "+Utilitaire.formaterDate(resultats.getDate(2)));
                while(resultats.next())
                {
                    if(resultats.getInt(1) != ida)
                    modele.addRow(data);
                    table.setValueAt(resultats.getInt(1),i,0);
                    table.setValueAt(Utilitaire.formaterDate(resultats.getDate(2)),i,1);
                    table.setValueAt(Utilitaire.formaterDate(resultats.getDate(3)),i,2);
                    table.setValueAt(Utilitaire.formaterDate(resultats.getDate(4)),i,3);
                    table.setValueAt(resultats.getString(5),i,4);
                    i++;
                }
                resultats.close();
                connexion.closeConn();
            }
            catch(Exception ex)
            {
                System.out.println("Annexe : Erreur lors de l'affichage du tableau Upload! "+ex.getMessage());
                ex.printStackTrace();
            }
    Résultat:
    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
     HHHHHHHHHHHHHH Annexe : Erreur lors de l'affichage du tableau Upload! null
    java.lang.NullPointerException
            at com.mysql.jdbc.ResultSetImpl.getDate(ResultSetImpl.java:2019)
            at com.mysql.jdbc.ResultSetImpl.getDate(ResultSetImpl.java:1982)
            at coactivite2.Annexe.AffichageUpload(Annexe.java:313)
            at coactivite2.Fenetre.MenuOngletFocusGained(Fenetre.java:6238)
            at coactivite2.Fenetre.access$6000(Fenetre.java:30)
            at coactivite2.Fenetre$62.focusGained(Fenetre.java:3927)
            at java.awt.AWTEventMulticaster.focusGained(AWTEventMulticaster.java:203)
            at java.awt.Component.processFocusEvent(Component.java:6177)
            at java.awt.Component.processEvent(Component.java:6044)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4651)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4481)
            at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
            at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:901)...
    Ca veut dire quoi java.lang.NullPointerException ? C'est forcement avant mon 2ème HHHHHHHHHH

    Donc la faute devrait se situer à ce niveau je pense :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    DefaultTableModel modele = (DefaultTableModel) table.getModel();
                Vector<Vector<String>> data = null;
                Connexion connexion = new Connexion();
                ResultSet resultats = connexion.getResultSet(query);
                int i = 0;
                Utilitaire.centrerTable(table);

  16. #276
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 711
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 711
    Points : 4 797
    Points
    4 797
    Par défaut
    La lumière verte est de retour ...

    Si on a : annexe.getDateCreation() = 04/11/2016
    Du temps d'Access, ta requête était :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     ... AND (#"+Utilitaire.formaterDateRequete(Utilitaire.stringToDate(annexe.getDateDeb()))+"# BETWEEN DateDeb AND DateFin ...
    formaterDateRequete mettait le mois en 1er et donc on avait :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     ... AND #11/04/2016# BETWEEN DateDeb AND DateFin ...
    Maintenant avec MySql on prend la date au format texte et on la change en date MySql avec la fonction STR_TO_DATE
    (qui est une fonction MySql et non pas Java)
    il faut donc que la requête soit écrite comme ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     ... AND  STR_TO_DATE('04-11-2016','%d-%m-%Y')  BETWEEN DateDeb AND DateFin ...
    du coup il faut modifier formaterDateRequete pour obtenir la chaîne "STR_TO_DATE('04-11-2016','%d-%m-%Y')"
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
        public static String formaterDateRequete(Date date)
        {
            SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
            String strDate = sdf.format(date);
            String expressionMySql  = "STR_TO_DATE(" + strDate + ",'%d-%m-%Y')";
            return expressionMySql ;
        }
    au final la requête :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     ... AND  " + Utilitaire.stringToDate(annexe.getDateDeb()) + "  BETWEEN DateDeb AND DateFin ...
    Conclusion :
    On est en train de ré-inventer la roue car tout cela est géré par les PreparedStatement
    Mais le problème est que l'application est écrite comme cela et qu'on prendrait plus de temps à tout transformer. On le fera à la fin si on a le temps.
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

  17. #277
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    J'ai effectué les corrections que tu souhaitais mais je constate ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    System.out.println("OOOOOOOOOOOOOOOOO "+Utilitaire.stringToDate(annexe.getDateDeb()));
    Résultat:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    OOOOOOOOOOOOOOOOO Fri Nov 04 00:00:00 CET 2016
    Alors que la petite fonction réalisé transforme correctement la date pour l'insertion en BDD :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Utilitaire.dateToDB(annexe.getDateCreation())
    Résultat :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    OOOOOOOOOOOOOOOOO 2016-11-04
    J'ai peur de ne pas suivre tout à fait là

  18. #278
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 711
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 711
    Points : 4 797
    Points
    4 797
    Par défaut
    Je ne comprends pas le dernier post :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    System.out.println("OOOOOOOOOOOOOOOOO "+Utilitaire.stringToDate(annexe.getDateDeb()));
    Je n'ai pas le code de stringToDate mis il est censé transformer un String en Date je suppose ?
    Mais quel est le rapport avec l'utilisation de formaterDateRequete ?
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

  19. #279
    Nouveau membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2015
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2015
    Messages : 340
    Points : 31
    Points
    31
    Par défaut
    En fait je ne passe pas par stringToDate mais par une fonction que j'ai faite :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
        public static String dateToDB(String chaine)
        {
            String[] split  = chaine.split("/");
            return split[2]+"-"+split[1]+"-"+split[0];
        }
    Elle me permet de transformer une date de type 24/02/2010 en 2010-02-24 simplement.
    Donc j'ai utiliser cette fonction dans ma requête

  20. #280
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 711
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 711
    Points : 4 797
    Points
    4 797
    Par défaut
    Maintenant est-ce que annexe.getDateFin() renvoi un objet Date ou un objet String ?
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. ListView qui change de taille mais n'affiche pas le contenu d'une ObservableCollection
    Par Atellane dans le forum Windows Presentation Foundation
    Réponses: 4
    Dernier message: 14/08/2014, 10h46
  2. DataGrid n'affiche pas le contenu de certaines colonnes d'un Datatable
    Par alucia dans le forum Windows Presentation Foundation
    Réponses: 3
    Dernier message: 20/09/2013, 13h39
  3. .load qui n'affiche pas le contenu de la page
    Par tonydu91 dans le forum jQuery
    Réponses: 4
    Dernier message: 06/04/2013, 23h58
  4. [SimpleXML] Problème avec simpleXML : il n'affiche pas le contenu de mon élément
    Par ploxien dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 05/05/2007, 19h43
  5. GUI Java par netbeans - ne s'affiche pas
    Par G_angel dans le forum AWT/Swing
    Réponses: 4
    Dernier message: 31/01/2007, 11h38

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