The Field class of the com.ms.wfc.data package encapsulates the ADO Field object, which represents a column of data with a data type.
public class Field { // Methods public void appendChunk(byte[] bytes); public void appendChunk(char[] chars); public void appendChunk(String chars); public int getActualSize(); public int getAttributes(); public void setAttributes(int attr); public boolean getBoolean(); public byte getByte(); public byte[] getByteChunk(int len); public byte[] getBytes(); public char[] getCharChunk(int len); public int getDefinedSize(); public double getDouble(); public float getFloat(); public int getInt(); public long getLong(); public String getName(); public int getNumericScale(); public Object getObject(); public Variant getOriginalValue(); public int getPrecision(); public AdoProperties getProperties(); public short getShort(); public String getString(); public String getStringChunk(int len); public int getType(); public Variant getUnderlyingValue(); public Variant getValue(); public boolean isNull(); public void setAttributes(int attr); public void setBoolean(boolean v); public void setByte(byte v); public void setBytes(byte[] v); public void setDefinedSize(int pl); public void setDouble(double v); public void setFloat(float v); public void setInt(int v); public void setLong(long v); public void setNull(); public void setNumericScale(byte pbNumericScale); public void setObject(Object v); public void setPrecision(byte pbPrecision); public void setShort(short v); public void setString(String v); public void setType(int t); public void setValue(Variant v); }
The Value property of a Field object gets or sets the content of that object. The content is represented as a VARIANT, a type of object that can be assigned a value and any of several data types.
ADO/WFC implements the Value property with the getValue method, which returns a VARIANT object; and the setValue method, which takes a VARIANT as an argument. VARIANTs are highly efficient in certain languages; however, you can get better performance in Microsoft® Visual J++® by using native Java data types.
In addition to the Value property, ADO/WFC provides accessor methods that use Java data types to get and set the content of Field objects. Most of these methods have names of the form getDataType and setDataType. These are documented in the AdoProperty class.
There are two noteworthy exceptions: One of the getObject methods returns an object coerced to a specified class. There is no getNull method; instead, there is an isNull method that returns a boolean value indicating whether the field is null.