";
String sql = "SELECT * FROM DUCKBURG_RESIDENTS";
// Let's ask the connection from the datasource!
try (Connection c = ds.getConnection()) {
try (Statement statement = c.createStatement()) {
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
result += rs.getString("id") + " "
+ rs.getString("firstname") + " "
+ rs.getString("lastname") + "\n";
}
}
} catch (Exception e) {
e.printStackTrace(System.out);
}
return result + "";
}
104