@Test public void testExec() { int count = Base.exec("insert into people (NAME, LAST_NAME, DOB) values('Mic', 'Jagger', ?)", getTimestamp(1962, 6, 13)); List<Map> results = Base.findAll("select * from people where last_name='Jagger'"); a(1).shouldBeEqual(results.size()); a(1).shouldBeEqual(count); }
public static int exec(String query){ return new DB(DB.DEFAULT_NAME).exec(query); }
Base { public static int exec(String query){ return new DB(DB.DEFAULT_NAME).exec(query); } }
Base { public static int exec(String query){ return new DB(DB.DEFAULT_NAME).exec(query); } private  Base(); }
Base { public static int exec(String query){ return new DB(DB.DEFAULT_NAME).exec(query); } private  Base(); static DB open(); static DB open(String driver, String url, String user, String password); static DB open(String driver, String url, Properties props); static DB open(String jndiName); static DB open(String jndiName, Properties jndiProperties); static DB open(DataSource dataSource); static Connection connection(); static boolean hasConnection(); static void close(boolean suppressWarning); static void close(); static Long count(String table); static Long count(String table, String query, Object... params); static Object firstCell(String query, Object... params); static List<Map> findAll(String query, Object... params); static List firstColumn(String query, Object... params); static List<Map> findAll(String query); static RowProcessor find(String query, Object ... params); static RowProcessor find(RowProcessor.ResultSetType type, RowProcessor.ResultSetConcur concur, int fetchSize, String query, Object ... params); static void find(String sql, RowListener listener); static int exec(String query); static int exec(String query, Object ... params); static void openTransaction(); static void commitTransaction(); static void rollbackTransaction(); static PreparedStatement startBatch(String parametrizedStatement); static void addBatch(PreparedStatement ps, Object... parameters); static int[] executeBatch(PreparedStatement ps); static void closePreparedStatement(PreparedStatement ps); static void attach(Connection connection); static Connection detach(); static T withDb(String jndiName, Properties jndiProperties, Supplier<T> supplier); static T withDb(DataSource dataSource, Supplier<T> supplier); static T withDb(String jndiName, Supplier<T> supplier); static T withDb(String driver, String url, Properties properties, Supplier<T> supplier); static T withDb(String driver, String url, String user, String password, Supplier<T> supplier); static T withDb(Supplier<T> supplier); }
Base { public static int exec(String query){ return new DB(DB.DEFAULT_NAME).exec(query); } private  Base(); static DB open(); static DB open(String driver, String url, String user, String password); static DB open(String driver, String url, Properties props); static DB open(String jndiName); static DB open(String jndiName, Properties jndiProperties); static DB open(DataSource dataSource); static Connection connection(); static boolean hasConnection(); static void close(boolean suppressWarning); static void close(); static Long count(String table); static Long count(String table, String query, Object... params); static Object firstCell(String query, Object... params); static List<Map> findAll(String query, Object... params); static List firstColumn(String query, Object... params); static List<Map> findAll(String query); static RowProcessor find(String query, Object ... params); static RowProcessor find(RowProcessor.ResultSetType type, RowProcessor.ResultSetConcur concur, int fetchSize, String query, Object ... params); static void find(String sql, RowListener listener); static int exec(String query); static int exec(String query, Object ... params); static void openTransaction(); static void commitTransaction(); static void rollbackTransaction(); static PreparedStatement startBatch(String parametrizedStatement); static void addBatch(PreparedStatement ps, Object... parameters); static int[] executeBatch(PreparedStatement ps); static void closePreparedStatement(PreparedStatement ps); static void attach(Connection connection); static Connection detach(); static T withDb(String jndiName, Properties jndiProperties, Supplier<T> supplier); static T withDb(DataSource dataSource, Supplier<T> supplier); static T withDb(String jndiName, Supplier<T> supplier); static T withDb(String driver, String url, Properties properties, Supplier<T> supplier); static T withDb(String driver, String url, String user, String password, Supplier<T> supplier); static T withDb(Supplier<T> supplier);  }