package test; import java.util.*; import java.sql.SQLException; import javax.ws.rs.*; import dbtackle.Database; @Path("customer") public class CustomerResource { @GET @Produces("application/xml") public List getCustomerList() { Database database = new DatabaseImpl(); try { return database.select(Customer.class, "SELECT " + " ID, " + " NAME, " + " BIRTHDAY, " + " ADDRESS, " + " SEX " + "FROM " + " CUSTOMER"); } catch (SQLException ex) { // something to do. return new ArrayList(); } finally { database.close(); } } }