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,19 +727,21 @@ 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);
if ("Y".equalsIgnoreCase(rs.getString(2)) && !Ini.isPropertyBool(Ini.P_PRINTPREVIEW)
&& !isPrintPreview )
directPrint = true;
} else { } else {
log.info("data not found; sql = "+sql); log.severe("data not found; sql = "+sql);
return null;
} }
if ("Y".equals(rs.getString(6)) && !Ini.isPropertyBool(Ini.P_PRINTPREVIEW)
&& !isPrintPreview ) return new ReportData( path, directPrint);
directPrint = true;
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());
return null; return null;