Tach zusammen,
Ich habe ein problem mit Pervasive und der Methode isLast() im ResultSet. Obwohl das ResultSet ein Type_Forward_Only ist wirft es eine Exception "Incorrect Cursor Type". Ich hab das ganze mal gegoogelt aber nichts gefunden. Hat jemand eine Idee?
isLast wird auf zeile 36 aufgerufen.
Hier mein Code:
Ich habe ein problem mit Pervasive und der Methode isLast() im ResultSet. Obwohl das ResultSet ein Type_Forward_Only ist wirft es eine Exception "Incorrect Cursor Type". Ich hab das ganze mal gegoogelt aber nichts gefunden. Hat jemand eine Idee?
isLast wird auf zeile 36 aufgerufen.
Hier mein Code:
Java:
Connection conn = (Connection) Def.getConn();
Statement st;
ResultSet rs;
String[] DKOList = new String[]{"13", "106"};
try {
st = (Statement) conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
rs = (ResultSet) st.executeQuery("Select Produkt.\"_USERFIELD8\" as SpezialNR, Produkt.\"_USERFIELD1\" as DZNR, Produkt.\"_USERFIELD2\" as EZNR, Produkt.\"_USERFIELD3\" as VERPNR, "
+ "ADRE_AKT.LINK, DEBI_DST.DNR, PUBL_AKP.ADR_INR, PUBL_ADR.EMAIL, "
+ "Kontakt.\"_USERFIELD8\" as Tagung, Kontakt.\"_USERFIELD7\"as Spezial, Kontakt.\"_USERFIELD3\" as DZ, Kontakt.\"_USERFIELD4\" as EZ, Kontakt.\"_USERFIELD5\" as Verpf "
+ "from ADRE_AKT "
+ "join ADRE_AKT_EXT as Aktiv on (ADRE_AKT.RECNUM$ = Aktiv.PARENT_RECNUM$) "
+ "join ORDE_ADO on(ADRE_AKT.LINK = ORDE_ADO.ART_NRA) "
+ "join ORDE_ADO_EXT as Produkt on (ORDE_ADO.RECNUM$ = Produkt.PARENT_RECNUM$) "
+ "join PUBL_ADR on (ADRE_AKT.ADR_INR = PUBL_ADR.INR) "
+ "join PUBL_AKP on (PUBL_ADR.INR = PUBL_AKP.ADR_INR and PUBL_AKP.FREI2SW = '1') "
+ "Join PUBL_AKP_EXT as Kontakt on (PUBL_AKP.RECNUM$ = Kontakt.PARENT_RECNUM$) "
+ "left outer join DEBI_DST on (PUBL_ADR.INR = DEBI_DST.INR) "
+ "Where ADRE_AKT.LINK = '" + CourseNr + "' and ADRE_AKT.AKA_ID ='KITA'" + AdreCheck);
switch(rs.getType()){
case 1003: System.out.println("TYPE_FORWARD_ONLY");break;
case 1004: System.out.println("TYPE_SCROLL_INSENSITIVE");break;
case 1005: System.out.println("TYPE_SCROLL_SENSITIVE");break;
}
float DZMenge = 0;
float EZMenge = 0;
float Verpf = 0;
float Tagung = 0;
float Spezial = 0;
while (rs.next()) {
if (rs.getInt("DEBI_DST.DNR") == 0) {
fail++;
fail2.add(rs.getString("ADR_INR"));
}
if (fail == 0) {
if ((tmpAdre != rs.getInt("ADR_INR") && tmpAdre != 0)|| rs.isLast()) {
String[] DKOWerte = new String[]{rs.getString("DNR"), rs.getString("LINK")};
try {
buffy.write(",N,DKO");
buffy.newLine();
for (int a = 0; a < DKOList.length; a++) {
buffy.write(",D,DKO," + DKOList[a] + "," + DKOWerte[a]);
buffy.newLine();
}
buffy.write(",S");
buffy.newLine();
if (Tagung > 0) {
buffy.write(",N,DPO");
buffy.newLine();
buffy.write(",D,DPO,6," + "A");
buffy.newLine();
buffy.write(",D,DPO,7," + rs.getString("LINK"));
buffy.newLine();
buffy.write(",D,DPO,12," + String.valueOf(Tagung));
buffy.newLine();
buffy.write(",S");
buffy.newLine();
}
if (DZMenge > 0) {
buffy.write(",N,DPO");
buffy.newLine();
buffy.write(",D,DPO,6," + "B");
buffy.newLine();
buffy.write(",D,DPO,7," + rs.getString("DZNR"));
buffy.newLine();
buffy.write(",D,DPO,12," + String.valueOf(DZMenge));
buffy.newLine();
buffy.write(",S");
buffy.newLine();
}
if (EZMenge > 0) {
buffy.write(",N,DPO");
buffy.newLine();
buffy.write(",D,DPO,6," + "B");
buffy.newLine();
buffy.write(",D,DPO,7," + rs.getString("EZNR"));
buffy.newLine();
buffy.write(",D,DPO,12," + String.valueOf(EZMenge));
buffy.newLine();
buffy.write(",S");
buffy.newLine();
}
if (Verpf > 0) {
buffy.write(",N,DPO");
buffy.newLine();
buffy.write(",D,DPO,6," + "B");
buffy.newLine();
buffy.write(",D,DPO,7," + rs.getString("VERPNR"));
buffy.newLine();
buffy.write(",D,DPO,12," + String.valueOf(Verpf));
buffy.newLine();
buffy.write(",S");
buffy.newLine();
}
if (Spezial > 0) {
buffy.write(",N,DPO");
buffy.newLine();
buffy.write(",D,DPO,7," + rs.getString("Spezial"));
buffy.newLine();
buffy.write(",D,DPO,6," + "B");
buffy.newLine();
buffy.write(",D,DPO,12," + String.valueOf(Verpf));
buffy.newLine();
buffy.write(",S");
buffy.newLine();
}
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
DZMenge = 0;
EZMenge = 0;
Verpf = 0;
Tagung = 0;
Spezial = 0;
if (canc == 0) {
Runtime rt = Runtime.getRuntime();
Process z;
try {
//if (rs.getString("PUBL_ADR.EMAIL").equals("")) {
z = rt.exec(Def.getAbaview().getAbsolutePath() + " -q1='" + CourseNr + "' -q2='" + AdreNr == null ? rs.getString("PUBL_ADR.INR") : AdreNr + "' -p " + Def.getReport().getAbsolutePath());
z.waitFor();
//} else {
// z = rt.exec(Def.getAbaview().getAbsolutePath() + " -q1='" + CourseNr + "' -q2='" + AdreNr == null ? rs.getString("PUBL_ADR.INR") : AdreNr + "' -pMailTo:" + rs.getString("PUBL_ADR.EMAIL") + " " + Def.getMailReport().getAbsolutePath());
// z.waitFor();
//}
} catch (InterruptedException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
Tagung = Tagung + rs.getFloat("Tagung");
Spezial = Spezial + rs.getFloat("Spezial");
Verpf = Verpf + rs.getFloat("Verpf");
EZMenge = EZMenge + rs.getFloat("EZ");
DZMenge = DZMenge + rs.getFloat("DZ");
tmpAdre = rs.getInt("ADR_INR");
}
}
st.close();
conn.close();
try {
buffy.close();
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (SQLException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}