public MockUpdateCountArrayWrapper(int[] updateCounts, Map parameters) { super(parameters); this.updateCounts = (Integer[])ArrayUtil.convertToObjectArray(updateCounts); }
public MockUpdateCountArrayWrapper(int[] updateCounts, Map parameters) { super(parameters); this.updateCounts = (Integer[])ArrayUtil.convertToObjectArray(updateCounts); }
/** * Prepare an array update count values for <code>executeUpdate</code> calls * for a specified SQL string. This method can be used if multiple update counts * are returned. * Please note that you can modify the match parameters with {@link #setCaseSensitive}, * {@link #setExactMatch} and {@link #setUseRegularExpressions}. * @param sql the SQL string * @param updateCounts the update count array */ public void prepareUpdateCounts(String sql, int[] updateCounts) { updateCountForStatement.put(sql, ArrayUtil.convertToObjectArray(updateCounts)); }
/** * Prepare an array update count values for <code>executeUpdate</code> calls * for a specified SQL string. This method can be used if multiple update counts * are returned. * Please note that you can modify the match parameters with {@link #setCaseSensitive}, * {@link #setExactMatch} and {@link #setUseRegularExpressions}. * @param sql the SQL string * @param updateCounts the update count array */ public void prepareUpdateCounts(String sql, int[] updateCounts) { updateCountForStatement.put(sql, ArrayUtil.convertToObjectArray(updateCounts)); }
public String toString() { StringBuffer buffer = new StringBuffer("Array data: ["); Object[] arrayData = ArrayUtil.convertToObjectArray(array); for(int ii = 0; ii < arrayData.length; ii++) { buffer.append(arrayData[ii]); if(ii < arrayData.length - 1) { buffer.append(", "); } } buffer.append("]"); return buffer.toString(); }
public String toString() { StringBuffer buffer = new StringBuffer("Array data: ["); Object[] arrayData = ArrayUtil.convertToObjectArray(array); for(int ii = 0; ii < arrayData.length; ii++) { buffer.append(arrayData[ii]); if(ii < arrayData.length - 1) { buffer.append(", "); } } buffer.append("]"); return buffer.toString(); }
@Override public String toString() { StringBuilder buffer = new StringBuilder("Array data: ["); Object[] arrayData = ArrayUtil.convertToObjectArray(array); for(int ii = 0; ii < arrayData.length; ii++) { buffer.append(arrayData[ii]); if(ii < arrayData.length - 1) { buffer.append(", "); } } buffer.append("]"); return buffer.toString(); }
public ResultSet getResultSet(long index, int count) throws SQLException { if(wasFreeCalled) { throw new SQLException("free() was called"); } Integer[] firstColumn = new Integer[count]; for(int ii = 0; ii < count; ii++) { firstColumn[ii] = new Integer(ii + 1); } Object[] secondColumn = ArrayUtil.convertToObjectArray(array); secondColumn = (Object[])ArrayUtil.truncateArray(secondColumn, (int)(index - 1), count); MockResultSet resultSet = new MockResultSet(String.valueOf(hashCode())); resultSet.setResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE); resultSet.setResultSetConcurrency(ResultSet.CONCUR_READ_ONLY); resultSet.addColumn(firstColumn); resultSet.addColumn(secondColumn); return resultSet; }
public ResultSet getResultSet(long index, int count) throws SQLException { if(wasFreeCalled) { throw new SQLException("free() was called"); } Integer[] firstColumn = new Integer[count]; for(int ii = 0; ii < count; ii++) { firstColumn[ii] = new Integer(ii + 1); } Object[] secondColumn = ArrayUtil.convertToObjectArray(array); secondColumn = (Object[])ArrayUtil.truncateArray(secondColumn, (int)(index - 1), count); MockResultSet resultSet = new MockResultSet(String.valueOf(hashCode())); resultSet.setResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE); resultSet.setResultSetConcurrency(ResultSet.CONCUR_READ_ONLY); resultSet.addColumn(firstColumn); resultSet.addColumn(secondColumn); return resultSet; }
public ResultSet getResultSet(long index, int count) throws SQLException { if(wasFreeCalled) { throw new SQLException("free() was called"); } Integer[] firstColumn = new Integer[count]; for(int ii = 0; ii < count; ii++) { firstColumn[ii] = ii + 1; } Object[] secondColumn = ArrayUtil.convertToObjectArray(array); secondColumn = (Object[])ArrayUtil.truncateArray(secondColumn, (int)(index - 1), count); MockResultSet resultSet = new MockResultSet(String.valueOf(hashCode())); resultSet.setResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE); resultSet.setResultSetConcurrency(ResultSet.CONCUR_READ_ONLY); resultSet.addColumn(firstColumn); resultSet.addColumn(secondColumn); return resultSet; }