Bonjour tout le monde,

J'ai une erreur de ce type lorsque j'utilise 2 boucles rs.next() de 2 requêtes différentes:
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
 
java.sql.SQLException: L'élément ResultSet n'est pas ouvert.  Vérifiez que la fonction de validation automatique est désactivée (OFF).
	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.next(Unknown Source)
	at vue.GraphiqueEtatPatient.<init>(GraphiqueEtatPatient.java:101)
	at vue.Fenetre.graphEtatP(Fenetre.java:473)
	at vue.Fenetre.actionPerformed(Fenetre.java:538)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: org.apache.derby.client.am.SqlException: L'élément ResultSet n'est pas ouvert.  Vérifiez que la fonction de validation automatique est désactivée (OFF).
	at org.apache.derby.client.am.ResultSet.checkForClosedResultSet(Unknown Source)
	at org.apache.derby.client.am.ResultSet.nextX(Unknown Source)
	... 29 more
Quelqu'un peut-il me dire ce que signifie ce charabia ?

Voici ce que je fais:

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
try {
			connection = DriverManager.getConnection(URL + USER + PWD);
			Statement stmt = connection.createStatement();
			ResultSet rs = stmt.executeQuery("SELECT mesure.*, ref, nom FROM mesure, patient WHERE id_patient=ref");
			int nbreMesure = 0;
			int day, month, year;
			
			// Creation des lignes
			TimeSeries mesure_patient = null;
			//series_ligne_2 = new TimeSeries("Patient 2", Hour.class);
			dataSet.removeAllSeries();
			
			int nbrepatient = 3;//ado.recupRefPatient();
			for(int n = 1; n<nbrepatient; n++){
				Statement stm = connection.createStatement();
				ResultSet res = stmt.executeQuery("SELECT nom FROM patient WHERE ref="+n);
				while (res.next()){
					String nom_patient = (String)res.getObject(1);
					System.out.println("nom_patient: "+nom_patient);
					while (rs.next()){
//						int refpatient =  rs.getInt(8);
//						System.out.println("refpatient: "+refpatient);
				
						mesure_patient = new TimeSeries(nom_patient, Hour.class);
						if (rs.getInt(7)==n){
							nbreMesure++;
							System.out.println("nbreMesure: "+nbreMesure);
					
							date=(String) rs.getObject(4);
							glycemie=(Double) rs.getObject(5);
					
							day = Integer.parseInt(date.substring(0,2));
							System.out.println("dat: "+day);
							month = Integer.parseInt(date.substring(3,5));
							System.out.println("mois: "+month);
							year = Integer.parseInt(date.substring(6,10));
							System.out.println("annee: "+year);
							System.out.println("glycemie: "+glycemie);
					
							mesure_patient.setNotify(true);
							mesure_patient.add(new Hour(nbreMesure,day,month,year), glycemie);
						}
					}
					// Ajout des ligne dans le dataset
					dataSet.addSeries(new TimeSeries(nom_patient, Hour.class));
					//dataSet.addSeries(series_ligne_2);
				}
			}
L'erreur provient de la 2ème boucle (en gras).
merci