/** * Whether this execution context is a from a batch statement. * * @return Whether this execution context is a from a batch statement. */ public boolean batch() { return batchSingle() || batchMultiple(); }
@Override public MockResult[] execute(MockExecuteContext ctx) throws SQLException { if (ctx.batch()) { throw new SQLFeatureNotSupportedException("Not yet supported"); String sql = ctx.sql(); String inlined = null; inlined = create.query(sql, ctx.bindings()).toString(); list = matchExactly.get(inlined);
@Override public int[] executeBatch() throws SQLException { checkNotClosed(); Object[][] matrix = new Object[bindings.size() - 1][]; for (int i = 0; i < bindings.size() - 1; i++) matrix[i] = bindings.get(i).toArray(); result = data.execute(new MockExecuteContext(sql.toArray(new String[0]), matrix)); int[] rows = new int[result.length]; for (int i = 0; i < result.length; i++) rows[i] = result[i].rows; return rows; }
@Override public MockResult[] execute(MockExecuteContext ctx) throws SQLException { if (ctx.batch()) { throw new SQLFeatureNotSupportedException("Not yet supported"); String sql = ctx.sql(); String inlined = null; inlined = create.query(sql, ctx.bindings()).toString(); list = matchExactly.get(inlined);
@Override public int[] executeBatch() throws SQLException { checkNotClosed(); Object[][] matrix = new Object[bindings.size() - 1][]; for (int i = 0; i < bindings.size() - 1; i++) { matrix[i] = bindings.get(i).toArray(); } result = data.execute(new MockExecuteContext(sql.toArray(new String[sql.size()]), matrix)); int[] rows = new int[result.length]; for (int i = 0; i < result.length; i++) { rows[i] = result[i].rows; } return rows; }
/** * Whether this execution context is a from a batch statement. * * @return Whether this execution context is a from a batch statement. */ public boolean batch() { return batchSingle() || batchMultiple(); }
@SuppressWarnings("unused") private boolean execute0( String localSql, int localResultSetType, int localResultSetConcurrency, int localResultSetHoldability, int localAutoGeneratedKeys, int[] localColumnIndexes, String[] localColumnNames) throws SQLException { checkNotClosed(); MockExecuteContext context = new MockExecuteContext( new String[] { localSql }, new Object[][] { bindings().toArray() }, localAutoGeneratedKeys, localColumnIndexes, localColumnNames ); MockStatement.this.result = data.execute(context); return result != null && result.length > 0 && result[resultIndex].data != null; }
@SuppressWarnings("unused") private boolean execute0( String localSql, int localResultSetType, int localResultSetConcurrency, int localResultSetHoldability, int localAutoGeneratedKeys, int[] localColumnIndexes, String[] localColumnNames) throws SQLException { checkNotClosed(); MockExecuteContext context = new MockExecuteContext( new String[] { localSql }, new Object[][] { bindings().toArray() }, localAutoGeneratedKeys, localColumnIndexes, localColumnNames, unbox(outParameterTypes) ); result = data.execute(context); return result != null && result.length > 0 && result[resultIndex].data != null; }