ORA-01000: nombre maximum de curseurs ouverts dépassé
Bonjour,
Je suis nouveau sur le forum.
Je débute en SQL et avec Oracle et j'ai un souci avec le nombre de curseurs . J'ai vu cependant que le souci a déjà été abordé dans un forum mais il date.
Je vous fais voir mon code. Je pense les avoir tous fermés correctement et le nombre de curseurs max est de 600 .
Code:
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
| SGBDFwk objcSGBDGESTEMPS = new SGBDFwk("r",
"",
"",
"");
SGBDFwk objlSGBD = new SGBDFwk("",
"",
"",
"CT");
objcSGBDGESTEMPS.connect();
objlSGBD.connect();
try {
PreparedStatement objlLib = objlSGBD.prepare("SELECT LIB FROM TGROUPES WHERE NIVEAU = 1");
ResultSet objlResult;
objlResult = objlLib.executeQuery();
String strlLib;
StringBuffer strlKey;
while(objlResult.next()){
strlKey = new StringBuffer();
strlLib = new String(objlResult.getBytes("LIB"),"ISO-8859-1");
for(int intlCpt = 0; intlCpt < strlLib.length(); intlCpt++){
if (Character.isAlphabetic(strlLib.charAt(intlCpt)) || strlLib.charAt(intlCpt) == ' ')
strlKey.append(strlLib.charAt(intlCpt));
}
if (strlKey.toString() != "")
map.put(strlKey.toString(), strlLib);
}
objlLib.close();
objlResult.close();
map.forEach((key, value) -> {
System.out.println(key);
PreparedStatement objlStmtRecup = objcSGBDGESTEMPS.prepare("SELECT ent.raison_sociale, cli.codeclient"
+ " FROM gestemps.cli_entreprise ent, gestemps.cli_client cli, gestemps.cli_dossier dos"
+ " WHERE ent.id=dos.id"
+ " AND dos.date_sortie IS NULL AND cli.id = id_cli_client"
+ "AND ent.raison_sociale LIKE '%"+key+"%'");
try {
ResultSet objlRaison = objlStmtRecup.executeQuery();
if (objlRaison.next()){
String strlValeur = value+";"+objlRaison.getString(1)+";"+objlRaison.getString(2)+"\n";
Files.write(Paths.get("/mnt/data/extract/Corres.txt"), strlValeur.getBytes(), StandardOpenOption.APPEND);
}
objlRaison.close();
objlStmtRecup.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
});
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally{
objlSGBD.disconnect();
objcSGBDGESTEMPS.disconnect();
}
}
} |
Je ne comprends pas où est mon soucis.
Merci beaucoup .
Bye