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 :

Erreur requete sql fonctionne pas


Sujet :

JDBC Java

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2016
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2016
    Messages : 9
    Points : 7
    Points
    7
    Par défaut Erreur requete sql fonctionne pas
    Bonjour, je code un projet pour mon cours de Java, pour cela nous codons sur netBeans 8.0.1 avec un base de données dans netbeans donc derby.

    Mais j'ai un problème: un nullpointerexception lorsque j'essaie de rechercher dans la bd avec certains critères.

    Voici ma classe interface :
    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
     
    package view;
     
    import controller.AnimalSearchController;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    import java.util.*;
    import javax.swing.*;
     
    public class SearchAnimalPanel extends JPanel
    {
        private MainWindow mainWindow;
        private Container cont;
     
        private JLabel numPharma,sendDate;
        private JSpinner spinnerDate;
        private JComboBox comboPharma;
        private JPanel panelInfo,panelButton;
        private JButton search;
        private Calendar calendar;
        private AnimalSearchController asec;
        private java.util.Date date;
        private java.sql.Date dateEnvoi;
        private int matPharma;
     
        public SearchAnimalPanel (MainWindow mainWindow)
        {
            this.mainWindow = mainWindow;
            cont=mainWindow.getContentPane();
     
            panelInfo = new JPanel();
            panelButton = new JPanel();
     
            panelInfo.setLayout(new GridLayout(3,2));
     
            this.setBorder(BorderFactory.createTitledBorder("Recherche animal"));
            setLayout(new BorderLayout());
     
            add(panelInfo);
            add(panelButton,BorderLayout.SOUTH);
     
            asec = new AnimalSearchController();
     
            numPharma = new JLabel("Matricule et nom du pharmacien : ");
            numPharma.setHorizontalAlignment(SwingConstants.RIGHT);
            comboPharma = new JComboBox(asec.getPharmaTab());
     
            sendDate = new JLabel("Date d'envoi de l'ordonnance : ");
            sendDate.setHorizontalAlignment(SwingConstants.RIGHT);
            calendar = Calendar.getInstance();
            SpinnerModel model = new SpinnerDateModel(calendar.getTime(),null,calendar.getTime(),Calendar.DAY_OF_MONTH);
            spinnerDate = new JSpinner(model);
            JComponent editor = new JSpinner.DateEditor(spinnerDate,"dd/MM/yyyy");
            spinnerDate.setEditor(editor);
     
            panelInfo.add(numPharma);
            panelInfo.add(comboPharma);
            panelInfo.add(sendDate);
            panelInfo.add(spinnerDate);
     
            search = new JButton("chercher");
     
            panelButton.add(search);
     
            ActionButtonSearchAnimal aBSA = new ActionButtonSearchAnimal();
            search.addActionListener(aBSA);
     
        }
     
        public void enableAnimalSearch(Boolean e)
        {
            mainWindow.enableMenu(e);                 
            comboPharma.setEnabled(e);
            spinnerDate.setEnabled(e);
            search.setEnabled(e);
        }
     
        public MainWindow getMainWindow()
        {
            return mainWindow;
        }
     
        private class ActionButtonSearchAnimal implements ActionListener
        {
            public void actionPerformed(ActionEvent e)
                {
                    if(e.getSource() == search)
                    {
                        date = (java.util.Date)spinnerDate.getValue();
                        dateEnvoi=  new java.sql.Date(date.getTime());
                        String pharma = comboPharma.getSelectedItem().toString();
                        String matString = pharma.substring(0,2);
                        matPharma = Integer.parseInt(matString);
                        SearchAnimalPanelResult searchAnimalPanelResult = new SearchAnimalPanelResult(mainWindow,SearchAnimalPanel.this,matPharma,dateEnvoi);
                    }
                }
        }
    }
    ensuite: j'ai une classe controller:
    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
    package controller;
     
    import business.*;
    import java.sql.Date;
    import model.*;
     
    public class AnimalSearchController {
     
        private AnimalSearchManager asem;
     
        public AnimalSearchController()
        {
            asem = new AnimalSearchManager();
        }
     
        public AnimalSearchAff[] getAnimSearch(int matP,Date dateE)
        {
            return asem.getTabAnimalSearch(matP,dateE);
        }
     
        public String[] getPharmaTab()
        {
            PharmacistObject[] tabObjectPh = new PharmacistObject[asem.getTabPharma().length];
            tabObjectPh = asem.getTabPharma();
            String[] tabPh = new String[tabObjectPh.length];
            for (int i=0;i<tabObjectPh.length;i++)
            {
                tabPh[i] = tabObjectPh[i].toString();
            }
            return tabPh;
        }
    }
    ensuite classe manager:
    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
    package business;
     
    import dataAccess.*;
    import java.sql.Date;
    import java.util.ArrayList;
    import model.*;
     
    public class AnimalSearchManager {
     
        private AnimalSearchDBAccess asea;
     
        public AnimalSearchManager()
        {
            asea = new AnimalSearchDBAccess();
        }
     
        private AnimalSearchAff[] transformationAnimalSearch(ArrayList<AnimalSearchAff>infoAnimalSheet)
        {
            AnimalSearchAff[] tabAnimalSearch = new AnimalSearchAff[infoAnimalSheet.size()];
     
            for (int i = 0;i<infoAnimalSheet.size();i++)
            {
                tabAnimalSearch[i] = infoAnimalSheet.get(i);
            }
            return tabAnimalSearch;
        }
     
        public AnimalSearchAff[] getTabAnimalSearch(int matPh,Date dateEnvoi)
        {
            return transformationAnimalSearch(asea.getAllSearchRecordAnimal(matPh,dateEnvoi));
        }
     
        private PharmacistObject[] transformationPharma(ArrayList<Integer>arrayMatPh,ArrayList<String>arrayNomPh)
        {
            PharmacistObject[] tabPharma = new PharmacistObject[arrayMatPh.size()];
     
            for (int i = 0;i<arrayMatPh.size();i++)
            {
                tabPharma[i] = new PharmacistObject(arrayMatPh.get(i),arrayNomPh.get(i));
            }
            return tabPharma;
        }
     
        public PharmacistObject[] getTabPharma()
        {
            return transformationPharma(asea.getMatriculePh(),asea.getNomPh());
        }
    }
    et enfin la classe d'access a la base de donnée:
    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
    package dataAccess;
     
    import java.sql.*;
    import java.util.ArrayList;
    import model.*;
     
    public class AnimalSearchDBAccess implements AnimalSearchDBAccessInterface
    {
        private Connection connection;
     
        public ArrayList<AnimalSearchAff> getAllSearchRecordAnimal(int matricule,Date dateEnvoi)
        {
            try
            {
                connection = SingleConnection.getInstance();
                AnimalSearchAff animalSearchAff;
                ResultSet donnees;
     
                String requeteSQL = " select numRegistre,espece,aTatouage,aPuce from Fiche_Signaletique_Animal"
                                  + " where numRegistre = (select animalAff from Ordonnance"
                                  + "                     where dateEnvoi = ? "
                                  + "                     where numRegistre = (select matricule from Pharmacien"
                                  + "                                        where matricule = ?))";
     
                PreparedStatement prepStat = connection.prepareStatement(requeteSQL);
                prepStat.setDate(1,dateEnvoi);
                prepStat.setInt(2,matricule);
                donnees = prepStat.executeQuery();
     
                ArrayList<AnimalSearchAff>allAnimalSearchList = new ArrayList<>();
     
                while(donnees.next())
                {
                    animalSearchAff = new AnimalSearchAff(donnees.getInt("matricule"),donnees.getString("espece"),donnees.getBoolean("aTatouage"),donnees.getBoolean("aPuce"));
                    allAnimalSearchList.add(animalSearchAff);
                }
     
                return allAnimalSearchList;
            }
            catch(Exception e)
            {
                //throw new dataException
            }
            return null;
        }
     
        public ArrayList<Integer> getMatriculePh()
        {
            try
            {
                connection = SingleConnection.getInstance();
                ResultSet donnees;
     
                String requeteSQL = "select matricule from Pharmacien";
     
                PreparedStatement prepStat = connection.prepareStatement(requeteSQL);
     
                donnees = prepStat.executeQuery();
     
                ArrayList<Integer> arrayMatPh = new ArrayList<>();
     
               while(donnees.next())
               {
                   arrayMatPh.add(donnees.getInt("matricule"));
               }
     
                return arrayMatPh;
            }
            catch(Exception e)
            {
               // throw new dataException();
            }
            return null;
        }
     
        public ArrayList<String> getNomPh()
        {
            try
            {
                connection = SingleConnection.getInstance();
                ResultSet donnees;
     
                String requeteSQL = "select nom from Pharmacien";
     
                PreparedStatement prepStat = connection.prepareStatement(requeteSQL);
     
                donnees = prepStat.executeQuery();
     
                ArrayList<String> arrayNomPh = new ArrayList<>();
     
               while(donnees.next())
               {
                   arrayNomPh.add(donnees.getString("nom"));
               }
     
                return arrayNomPh;
            }
            catch(Exception e)
            {
               // throw new dataException();
            }
            return null;
        }
    }
    et voici l'erreur:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at business.AnimalSearchManager.transformationAnimalSearch(AnimalSearchManager.java:19)
    at business.AnimalSearchManager.getTabAnimalSearch(AnimalSearchManager.java:30)
    at controller.AnimalSearchController.getAnimSearch(AnimalSearchController.java:18)
    at view.SearchAnimalPanelResult.<init>(SearchAnimalPanelResult.java:45)
    at view.SearchAnimalPanel$ActionButtonSearchAnimal.actionPerformed(SearchAnimalPanel.java:95)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6535)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6300)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Voila du coup j'ai fait des testes je sais que les variables de la requete sql sont bien remplies et meme quand je test en remplacant ces variables par les bonnes valeurs, j'ai la meme erreur

  2. #2
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2016
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2016
    Messages : 9
    Points : 7
    Points
    7
    Par défaut
    Voici également le code de la connection à la db:
    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
    package dataAccess;
     
    //import Model.ConnectionException;
    import java.sql.Connection;
    //import java.sql.PreparedStatement;
    import java.sql.SQLException;
    //import java.util.logging.Level;
    //import java.util.logging.Logger;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
     
     
    public class SingleConnection 
    {
        private static Connection connection;
     
        public static Connection  getInstance() //throws ConnectionException
        {
             if(connection == null)
                {
                 try
                 {    
                    Context ctx = new InitialContext();
                    DataSource source = (DataSource)ctx.lookup("jdbc/Vandendooren");
                    connection = source.getConnection();
                }
                catch(SQLException | NamingException ex)
                {
                    //throw new ConnectionException(ex.getMessage());
                }
                }
             return connection;
        }
    }
    et le script sql de la bd:
    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
    CREATE TABLE Pharmacien
    	(matricule numeric(2) constraint Pharmacien_pk Primary Key,
    	nom varchar(50) not null,
    	prenom varchar(20) not null,
    	email varchar(40) not null,
    	salaire numeric(6,2) not null);
     
    CREATE TABLE Prepose_a_l_accueil
    	(matricule numeric(4) constraint Prepose_pk Primary Key,
    	nom varchar(25) not null,
    	prenom varchar(10) not null);
     
    CREATE TABLE Fiche_Signaletique_Animal
    	(numRegistre numeric(6) constraint FicheSign_pk Primary Key,
    	nomAnimal varchar(20) not null,
    	espece varchar(25) not null,
    	couleurPelage varchar(15) not null,
    	couleurPeau varchar(15) not null,
    	aTatouage boolean not null,
    	aPuce boolean not null,
    	dateEntree date not null,
    	remarque varchar(500),
    	preposeAff numeric(4) not null,
    	constraint FicheSign_fk_Prepose foreign key(preposeAff) references Prepose_a_l_accueil);
     
    CREATE TABLE Ordonnance
    	(numeroOrd numeric(2) constraint Ordonnance_pk Primary Key,
    	dateEnvoi date not null,
    	etatOrd varchar(15) not null,
    	numRegistre numeric(2) not null,
    	animalAff numeric(6) not null,
    	constraint Ord_fk_FicheSign foreign key(animalAff) references Fiche_Signaletique_Animal,
    	constraint Ord_fk_Pharma foreign key(numRegistre) references Pharmacien);
     
    CREATE TABLE FicheSoin
    	(IDFiche numeric(7) constraint FicheSoin_pk Primary Key,
    	etatFicheSoin varchar(20) not null,
    	typeNourriture varchar(30) not null,
    	quantite numeric(4) not null,
    	heureRationnement time not null,
    	soinsBase varchar(200) not null,
    	dateProduction date not null,
    	animalAff numeric(6) not null,
    	soi_descrSoinAvance varchar(200),
    	soi_estRealise boolean,
    	constraint FicheSoin_fk_FicheSign foreign key(animalAff) references Fiche_Signaletique_Animal);
     
    CREATE TABLE Medicament
    	(medicament varchar(30) constraint Medicament_pk Primary Key,
    	ordonnanceAff numeric(2) not null,
    	constraint Medic_fk_Ord foreign key(ordonnanceAff) references Ordonnance);
     
    Insert into Pharmacien
    values (21,'Martos','Javier','javier.martos@gmail.com',2500),
     (22,'Marcq','Damien','damien.marcq@gmail.com',2300),
     (23,'Perbet','Jeremy','jeremy.perbet@gmail.com',2450),
     (24,'Tainmont','Clement','clement.tainmont@gmail.com',2100);
     
    Insert into Prepose_a_l_accueil
    values (3001,'Penneteau','Nicolas'),(3002,'Pollet','David');
     
    Insert into Fiche_Signaletique_Animal (numRegistre,nomAnimal,espece,couleurPelage,couleurPeau,aTatouage,aPuce,dateEntree,preposeAff)
    values (100001,'Poppy','Chien','Blond','Rose',false,true,'2016-04-12',3001),
     (100022,'Mistigri','Chat','Noir','Beige',false,false,'2016-04-21',3002);
    Insert into Fiche_Signaletique_Animal
    values (100031,'Plop','Renard','Roux','Rose',false,false,'2016-04-20','blessé à la pate arrière droite',3001);
     
    Insert into Ordonnance
    values (41,'2016-04-16','envoyée',24,100001),
     (42,'2016-04-22','recue',23,100022),
     (45,'2016-04-22','en cours',22,100031);
     
    Insert into FicheSoin (IDFiche,etatFicheSoin,typeNourriture,quantite,heureRationnement,soinsBase,dateProduction,animalAff)
    values (1231231,'a administrer','paté',200,'08:00:00','nettoyer et changer bandage','2016-04-23',100022),
    (1935653,'en cours','croquettes',250,'18:00:00','nourrir et abreuver','2016-04-20',100031);
    Insert into FicheSoin
    values (1524524,'fait','croquettes',300,'14:00:00','nettoyer animal et preparer materiel','2016-04-14',100001,'poser platre pate arriere droite',true);
     
    Insert into Medicament
    values ('Ronflix',41),
     ('Duporman',42),
     ('Martyros',42),
     ('Vitaplus',45);

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

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

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Ta liste revenant de ton DAO est nulle, commence déjà par supprimer ce genre
    de code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
            catch(Exception e)
            {
                //throw new dataException
            }
    Histoire de voir ce qui se passe. Ca ne sert à rien de cacher des erreurs sous le tapis et espérer que ça marche après.

  4. #4
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2016
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2016
    Messages : 9
    Points : 7
    Points
    7
    Par défaut
    Ca c'est parce que j'avais pas encore gerer les exceptions, maintenant c'est fait donc au lieu du message de la console j'ai mon exception qui est catch

  5. #5
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    peux-tu nous donner toute la trace de l´erreur genere .

    eric

  6. #6
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2016
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2016
    Messages : 9
    Points : 7
    Points
    7
    Par défaut
    c'est a dire?

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

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

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    C'st à dire soit ton problème est résolu et tu marques le sujet résolu, soit ça ne fonctionne toujours pas et tu nous montres l'exception que tu as enfin traitée.

  8. #8
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2016
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2016
    Messages : 9
    Points : 7
    Points
    7
    Par défaut
    Voici la trace:
    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
    java.sql.SQLException: Il n'existe aucune colonne nommée : matricule.  
    	at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
    	at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
    	at org.apache.derby.client.am.ResultSet.getInt(Unknown Source)
    	at dataAccess.AnimalSearchDBAccess.getAllSearchRecordAnimal(AnimalSearchDBAccess.java:35)
    	at business.AnimalSearchManager.getTabAnimalSearch(AnimalSearchManager.java:31)
    	at controller.AnimalSearchController.getAnimSearch(AnimalSearchController.java:19)
    	at view.SearchAnimalPanelResult.<init>(SearchAnimalPanelResult.java:46)
    	at view.SearchAnimalPanel$ActionButtonSearchAnimal.actionPerformed(SearchAnimalPanel.java:97)
    	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    	at java.awt.Component.processMouseEvent(Component.java:6535)
    	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    	at java.awt.Component.processEvent(Component.java:6300)
    	at java.awt.Container.processEvent(Container.java:2236)
    	at java.awt.Component.dispatchEventImpl(Component.java:4891)
    	at java.awt.Container.dispatchEventImpl(Container.java:2294)
    	at java.awt.Component.dispatchEvent(Component.java:4713)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    	at java.awt.Container.dispatchEventImpl(Container.java:2280)
    	at java.awt.Window.dispatchEventImpl(Window.java:2750)
    	at java.awt.Component.dispatchEvent(Component.java:4713)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    	at java.awt.EventQueue$4.run(EventQueue.java:731)
    	at java.awt.EventQueue$4.run(EventQueue.java:729)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

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

Discussions similaires

  1. [MySQL] J'ai une erreur (requete sql)que je ne comprends pas du tout Mysqlfetcharray()
    Par metou2703 dans le forum PHP & Base de données
    Réponses: 5
    Dernier message: 28/09/2009, 13h52
  2. Erreur requete SQL
    Par poipoipo dans le forum Administration
    Réponses: 1
    Dernier message: 16/03/2007, 22h00
  3. erreur requete sql
    Par mohamed_75 dans le forum MS SQL Server
    Réponses: 1
    Dernier message: 13/02/2007, 14h20
  4. Erreur requete SQL/Access
    Par polianita dans le forum Requêtes et SQL.
    Réponses: 4
    Dernier message: 08/06/2006, 15h20
  5. probleme avec requete sql aime pas les strings
    Par lil_jam63 dans le forum Bases de données
    Réponses: 3
    Dernier message: 24/02/2004, 14h45

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