package javaxt.sql;
import javaxt.json.JSONObject;
import java.util.HashMap;
import java.util.ArrayList;
import javaxt.json.JSONArray;
//******************************************************************************
//** Record Class
//******************************************************************************
/**
* Used to represent a record returned from a SQL query
*
******************************************************************************/
public class Record { //extends javaxt.utils.Record
protected Field[] fields;
//**************************************************************************
//** Constructor
//**************************************************************************
protected Record(Field[] fields){
if (fields==null) fields = new Field[0];
this.fields = fields;
}
//**************************************************************************
//** update
//**************************************************************************
/** Called by the move() and addNew() methods in Recordset
*/
protected void update(java.sql.ResultSet rs){
try{
for (int i=1; i<=fields.length; i++) {
Field Field = fields[i-1];
Field.setValue(rs==null ? null : new Value(rs.getObject(i)));
Field.requiresUpdate(false);
}
}
catch(Exception e){}
}
//**************************************************************************
//** getFields
//**************************************************************************
/** Used to retrieve the an array of fields in the current record.
*/
public Field[] getFields(){
Field[] arr = new Field[fields.length];
for (int i=0; i