public Collection<Hrad> getHrady() {
Statement stmt = con.createStatement();
ResultSet rs = con.executeQuery("select id, nazev from hrad");
Collection<Hrad> result = new ArrayList<Hrad>();
while(rs.next())
{
Hrad h = new Hrad();
h.setID(rs.getLong("id"));
h.setNazev(rs.getString("nazev"));
result.add(h);
}
rs.close();
stmt.close();
con.close();
return result;
}