try (Connection connection = getConnection()) {
try (PreparedStatement ps = connection.prepareStatement(
"""
CREATE TABLE IF NOT EXISTS islands (
id TEXT PRIMARY KEY,
owner_id TEXT NOT NULL,
location_x INTEGER NOT NULL,
location_z INTEGER NOT NULL,
size INTEGER NOT NULL
);
""")) {
ps.execute();
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
this is the first time i've encountered a scenario where i have multiple things that need to be closed. is it better to put both in one try with resource of separate it like what i have here?