Record Class

Used to represent a record returned from a SQL query

Constructors

There are no public constructors.

Public Methods

getFields( ) returns Field[]
Used to retrieve the an array of fields in the current record.
getField( String name ) returns Field
Returns a specific field in the array of fields. Returns null if the field name is not found.
getField( int i ) returns Field
Returns a specific field in the array of fields. Returns null if the index is out of range.
get( String fieldName ) returns Value
Returns the Value associated with a given field. Note the if the field doesn't exist in the result set, the method will return still return a Value. You can use the isNull() method on the Value to determine whether the value is null.
get( int i ) returns Value
Returns the Value associated with a given field. Note the if the field doesn't exist in the result set, the method will return still return a Value. You can use the isNull() method on the Value to determine whether the value is null.
set( String fieldName, Value fieldValue ) returns void
isDirty( ) returns boolean
Returns true if any of the fields have been modified. You can find which field has been modified using the Field.isDirty() method. Example:
    if (record.isDirty()){
        for (javaxt.sql.Field field : record.getFields()){
            if (field.isDirty()){
                String val = field.getValue().toString();
                System.out.println(field.getName() + ": " + val);
            }
        }
    }    
toJson( ) returns JSONObject
Returns a JSON representation of this record