private void allocateConsolidationProducts() {
int tmpProduct = -1;
consolProducts[0] = new ProductsSQLConsolidated();
try {
ResultSet rs = sqlStatement.executeQuery("SELECT CODE FROM PRODUCTS ORDER BY CODE ASC");
int i =1;
while (rs.next()) {
consolProducts[i] = new ProductsSQLConsolidated();
tmpProduct = Integer.parseInt(rs.getString("CODE"));
consolProducts[i].checked = false;
consolProducts[i].productCode = tmpProduct;
i++;
}
numberProducts = i;
rs.close();
} catch (SQLException se){
System.out.println("Products SQL code does not execute.");
}
} |