try(Connection connection = H4J.getStorage().getConnection()) {
try(PreparedStatement statement = connection.prepareStatement("SELECT * FROM server_articles")) {
try(ResultSet set = statement.executeQuery()) {
while(set.next()) {
PromoPiece p = new PromoPiece();
p.setId(set.getInt("id"));
p.setName(set.getString("name"));
p.setStory(set.getString("story"));
p.setButtonText(set.getString("button_text"));
p.setExternalURL(set.getString("url"));
p.setImage(set.getString("image"));
promos.add(p);
}
}
}