BoltNeo4jStatement extends Neo4jStatement { @Override public int executeUpdate(String sql) throws SQLException { StatementResult result = executeInternal(sql); SummaryCounters stats = result.consume().counters(); this.currentUpdateCount = stats.nodesCreated() + stats.nodesDeleted() + stats.relationshipsCreated() + stats.relationshipsDeleted(); this.currentResultSet = null; return this.currentUpdateCount; } private  BoltNeo4jStatement(BoltNeo4jConnectionImpl connection, int... rsParams); static Statement newInstance(boolean debug, BoltNeo4jConnectionImpl connection, int... rsParams); @Override ResultSet executeQuery(String sql); @Override int executeUpdate(String sql); @Override boolean execute(String sql); @Override int[] executeBatch();  }
@Test public void executeUpdateShouldThrowExceptionOnClosedStatement() throws SQLException { expectedEx.expect(SQLException.class); Connection connection = new BoltNeo4jConnectionImpl(mockSessionOpen()); Statement statement = connection.createStatement(); statement.close(); statement.executeUpdate(StatementData.STATEMENT_CREATE); }
@Test public void executeUpdateShouldThrowExceptionOnPreparedStatement() throws SQLException { expectedEx.expect(SQLException.class); Connection connection = new BoltNeo4jConnectionImpl(mockSessionOpen()); Statement statement = connection.prepareStatement(""); statement.executeUpdate(StatementData.STATEMENT_CREATE); }
@Ignore @Test public void executeUpdateShouldThrowExceptionOnCallableStatement() throws SQLException { expectedEx.expect(SQLException.class); Connection connection = new BoltNeo4jConnectionImpl(mockSessionOpen()); Statement statement = connection.prepareCall(null); statement.executeUpdate(StatementData.STATEMENT_CREATE); }