Har ett try, catch , finally block som strular.
try {
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT id, parent, name FROM category WHERE parent IS NULL");
while (rs.next()) {
Category category = new Category();
category.setID(rs.getInt("id"));
category.setParent(rs.getInt("parent"));
category.setName(rs.getString("name"));
categorys.add(category);
}
} catch (SQLException e) {
System.out.println(e.toString());
} finally {
rs.close();
stmt.close();
}
Problemet är att Eclipse säger att den inte kan resolva rs och stmt i finally blocket.
Vad har jag missat??