public Array createArrayOf(String typeName, Object[] elements) throws SQLException { MockArray array = new MockArray(elements); array.setBaseTypeName(typeName); return array; }
public Object getArray(long index, int count, Map map) throws SQLException { return getArray(index, count); }
public ResultSet getResultSet(long index, int count, Map map) throws SQLException { return getResultSet(index, count); }
public Array getArray(String parameterName) throws SQLException { Object value = getObject(parameterName); if(null != value) { if(value instanceof Array) return (Array)value; return new MockArray(value); } return null; }
public boolean equals(Object obj) { if(null == obj) return false; if(!obj.getClass().equals(this.getClass())) return false; MockArray other = (MockArray)obj; if(baseType != other.baseType) return false; if(null == sqlTypeName && null != other.sqlTypeName) return false; if(null != sqlTypeName && !sqlTypeName.equals(other.sqlTypeName)) return false; if(wasFreeCalled != other.wasFreeCalled()) return false; return ArrayUtil.areArraysEqual(array, other.array); }
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 Array getArray(String columnName) throws SQLException { Object value = getObject(columnName); if(null != value) { if(value instanceof Array) return (Array)value; return new MockArray(value); } return null; }
public boolean equals(Object obj) { if(null == obj) return false; if(!obj.getClass().equals(this.getClass())) return false; MockArray other = (MockArray)obj; if(baseType != other.baseType) return false; if(null == sqlTypeName && null != other.sqlTypeName) return false; if(null != sqlTypeName && !sqlTypeName.equals(other.sqlTypeName)) return false; if(wasFreeCalled != other.wasFreeCalled()) return false; return ArrayUtil.areArraysEqual(array, other.array); }
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 Array getArray(int columnIndex) throws SQLException { Object value = getObject(columnIndex); if(null != value) { if(value instanceof Array) return (Array)value; return new MockArray(value); } return null; }
public Array createArrayOf(String typeName, Object[] elements) throws SQLException { MockArray array = new MockArray(elements); array.setBaseTypeName(typeName); return array; }
public ResultSet getResultSet(long index, int count, Map map) throws SQLException { return getResultSet(index, count); }
public Object getArray(Map<String, Class<?>> map) throws SQLException { return getArray(); }
public boolean equals(Object obj) { if(null == obj) return false; if(!obj.getClass().equals(this.getClass())) return false; MockArray other = (MockArray)obj; if(baseType != other.baseType) return false; if(null == sqlTypeName && null != other.sqlTypeName) return false; if(null != sqlTypeName && !sqlTypeName.equals(other.sqlTypeName)) return false; if(wasFreeCalled != other.wasFreeCalled()) return false; return ArrayUtil.areArraysEqual(array, other.array); }
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; }
public Array getArray(String columnName) throws SQLException { Object value = getObject(columnName); if(null != value) { if(value instanceof Array) return (Array)value; return new MockArray(value); } return null; }
public Array createArrayOf(String typeName, Object[] elements) throws SQLException { MockArray array = new MockArray(elements); array.setBaseTypeName(typeName); return array; }
public ResultSet getResultSet(Map map) throws SQLException { return getResultSet(); }
public Object getArray(long index, int count, Map<String,Class<?>> map) throws SQLException { return getArray(index, count); }
public Array getArray(int parameterIndex) throws SQLException { Object value = getObject(parameterIndex); if(null != value) { if(value instanceof Array) return (Array)value; return new MockArray(value); } return null; }