Fixed wrong resultset column index and better exception/error handling

This commit is contained in:
deathmeat 2007-06-13 15:04:16 +00:00
parent df4f2335b3
commit daf66a462b
1 changed files with 10 additions and 8 deletions

View File

@ -727,18 +727,20 @@ public class ReportStarter implements ProcessCall {
pstmt.setInt(1, pi.getAD_PInstance_ID()); pstmt.setInt(1, pi.getAD_PInstance_ID());
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
String path = null; String path = null;
String tmp = null;
boolean directPrint = false; boolean directPrint = false;
boolean isPrintPreview = pi.isPrintPreview(); boolean isPrintPreview = pi.isPrintPreview();
if (rs.next()) { if (rs.next()) {
path = rs.getString(1); path = rs.getString(1);
tmp = rs.getString(2);
} else { if ("Y".equalsIgnoreCase(rs.getString(2)) && !Ini.isPropertyBool(Ini.P_PRINTPREVIEW)
log.info("data not found; sql = "+sql);
}
if ("Y".equals(rs.getString(6)) && !Ini.isPropertyBool(Ini.P_PRINTPREVIEW)
&& !isPrintPreview ) && !isPrintPreview )
directPrint = true; directPrint = true;
} else {
log.severe("data not found; sql = "+sql);
return null;
}
return new ReportData( path, directPrint); return new ReportData( path, directPrint);
} catch (SQLException e) { } catch (SQLException e) {
log.severe("sql = "+sql+"; e.getMessage() = "+ e.getMessage()); log.severe("sql = "+sql+"; e.getMessage() = "+ e.getMessage());