@Test public void testStatementClose() throws Exception { JDBCUtils.execute(connection, "sql"); verify(statement).execute("sql"); verify(statement).close(); }
public static void execute(Connection connection, String sql) throws SQLException { try (Statement statement = connection.createStatement()) { if (log.isDebugEnabled()) { log.debug(sql); } statement.execute(sql); } catch (SQLException e) { log.error(sql); throw e; } }
JDBCUtils { public static void execute(Connection connection, String sql) throws SQLException { try (Statement statement = connection.createStatement()) { if (log.isDebugEnabled()) { log.debug(sql); } statement.execute(sql); } catch (SQLException e) { log.error(sql); throw e; } } }
JDBCUtils { public static void execute(Connection connection, String sql) throws SQLException { try (Statement statement = connection.createStatement()) { if (log.isDebugEnabled()) { log.debug(sql); } statement.execute(sql); } catch (SQLException e) { log.error(sql); throw e; } }  }
JDBCUtils { public static void execute(Connection connection, String sql) throws SQLException { try (Statement statement = connection.createStatement()) { if (log.isDebugEnabled()) { log.debug(sql); } statement.execute(sql); } catch (SQLException e) { log.error(sql); throw e; } }  static List<SQLDataSourceDef> listDatasourceDefs(); static void execute(Connection connection, String sql); static T metadata(Connection connection, String sql, Function<ResultSetMetaData, T> callback); static ResultSetHandler executeQuery(Connection connection, String sql); static Dialect dialect(Connection connection); static Dialect dialect(String url, int majorVersion); static Dialect dialect(String dbName); static List<Column> getColumns(ResultSet resultSet, String[] exclude); static String fixCase(Connection connection, String id); static List<String> getWordsBetweenQuotes(String s); static String changeCaseExcludeQuotes(String s, boolean upper); static ColumnType calculateType(int sqlDataType); static String clobToString(Clob value); }
JDBCUtils { public static void execute(Connection connection, String sql) throws SQLException { try (Statement statement = connection.createStatement()) { if (log.isDebugEnabled()) { log.debug(sql); } statement.execute(sql); } catch (SQLException e) { log.error(sql); throw e; } }  static List<SQLDataSourceDef> listDatasourceDefs(); static void execute(Connection connection, String sql); static T metadata(Connection connection, String sql, Function<ResultSetMetaData, T> callback); static ResultSetHandler executeQuery(Connection connection, String sql); static Dialect dialect(Connection connection); static Dialect dialect(String url, int majorVersion); static Dialect dialect(String dbName); static List<Column> getColumns(ResultSet resultSet, String[] exclude); static String fixCase(Connection connection, String id); static List<String> getWordsBetweenQuotes(String s); static String changeCaseExcludeQuotes(String s, boolean upper); static ColumnType calculateType(int sqlDataType); static String clobToString(Clob value); static final Dialect DEFAULT; static final Dialect H2; static final Dialect MYSQL; static final Dialect POSTGRES; static final Dialect ORACLE; static final Dialect ORACLE_LEGACY; static final Dialect SQLSERVER; static final Dialect DB2; static final Dialect SYBASE_ASE; static final Dialect MONETDB; static final String[] QUOTES; }