private static String url = "jdbc:mysql://localhost:3306/";
public static void main(String[] args) throws Exception {
Connection connection = createConnection("test", "root", "geekdb");
Storage storage = new DatabaseStorage(connection);
List<Cat> cats = storage.list(Cat.class);
for (Cat cat : cats) {
storage.delete(cat);
}
cats = storage.list(Cat.class);
if (!cats.isEmpty()) throw new Exception("Cats should not be in database!");