} catch (Exception e) {
e.printStackTrace();
LOG.log(Level.WARNING, "Exception reading elements. Message: "
+ e.getMessage());
throw new ValidationLayerException(e.getMessage());
} finally {
if (rs != null) {
try {
rs.close();
} catch (SQLException ignore) {
}
rs = null;
}
if (statement != null) {
try {
statement.close();
} catch (SQLException ignore) {
}
statement = null;
}
if (conn != null) {
try {
conn.close();
} catch (SQLException ignore) {
}
conn = null;
}
}
// advance to the product parent
try {
conn = dataSource.getConnection();
statement = conn.createStatement();
String getParentSql = "SELECT parent_id from sub_to_super_map where product_type_id = ";
if (quoteFields) {
getParentSql += "'" + currProduct + "'";
} else {
getParentSql += currProduct;
}
LOG.log(Level.FINE, "getElements: Executing: " + getParentSql);
rs = statement.executeQuery(getParentSql);
currProduct = null;
while (rs.next()) {
currProduct = DbStructFactory.getParent(rs);
}
} catch (Exception e) {
e.printStackTrace();
LOG.log(Level.WARNING,
"Exception reading product parent. Message: "
+ e.getMessage());
throw new ValidationLayerException(e.getMessage());
} finally {
if (rs != null) {
try {
rs.close();
} catch (SQLException ignore) {