BoltNeo4jStatement extends Neo4jStatement { @Override public boolean execute(String sql) throws SQLException { StatementResult result = executeInternal(sql); boolean hasResultSet = false; if (result != null) { hasResultSet = hasResultSet(sql); if (hasResultSet) { this.currentResultSet = BoltNeo4jResultSet.newInstance(this.hasDebug(), this, result, this.resultSetParams); this.currentUpdateCount = -1; } else { this.currentResultSet = null; try { SummaryCounters stats = result.consume().counters(); this.currentUpdateCount = stats.nodesCreated() + stats.nodesDeleted() + stats.relationshipsCreated() + stats.relationshipsDeleted(); } catch (Exception e) { throw new SQLException(e); } } } return hasResultSet; } 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 executeShouldThrowExceptionOnQueryOnPreparedStatement() throws SQLException { expectedEx.expect(SQLException.class); Connection connection = new BoltNeo4jConnectionImpl(mockSessionOpen()); Statement statement = connection.prepareStatement(""); statement.execute(StatementData.STATEMENT_MATCH_ALL); }
@Ignore @Test public void executeShouldThrowExceptionOnCallableStatement() throws SQLException { expectedEx.expect(SQLException.class); Connection connection = new BoltNeo4jConnectionImpl(mockSessionOpen()); Statement statement = connection.prepareCall(""); statement.execute(StatementData.STATEMENT_MATCH_ALL); }