Вот как я бы порекомендовал вам написать:
public class HarmonogramDaoImpl implements HarmonogramDao {
private static final String FIND_ALL_SQL = "SELECT * FROM HARMONOGRAM ";
// inject this with either a constructor or setter
private Connection connection;
public List<Harmonogram> findAllHarmonograms() throws SQLException {
List<Harmonogram> harmonograms = new ArrayList<Harmonogram>();
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = this.connection.prepareStatement(FIND_ALL_SQL);
rs = ps.executeQuery();
while (rs.hasNext()) {
Harmonogram harm = new Harmonogram(rs.getLong(1), rs.getInt(2), rs.getInt(3), rs.getInt(4), rs.getLong(5), rs.getString(6));
harmonograms.add(harm);
}
} finally {
close(rs);
close(ps);
}
return harmonograms;
}
}
Есть несколько вещей, которые вы можете сделать или угадать, но это хорошее начало.