Class DbData

java.lang.Object
quadbase.reportdesigner.ReportAPI.DbData
All Implemented Interfaces:
IResultSet, IRow
Direct Known Subclasses:
DbDataCollection

public class DbData extends Object implements IResultSet
This class provides an implementation for the quadbase.reportdesigner.util.IResultSet interface using an array of data. IResultSet is used to provide input data to a report. DbData holds the data information necessary to plot a report. They are (i) data type for each column (ii) name for each column (iii) a list of data records
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Allocates a new DbData Object
     
    Construct DbData by parsing the data value argument in HTML page
     
    DbData(String[] fieldName, Object[][] records)
    Construct a new DbData class
     
    DbData(String[] dataType, String[] fieldName, String[][] records)
    Construct a new DbData class
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    For internal use only
    quadbase.reportdesigner.report.ColData[]
    For internal use only
    Object[][]
    Get the record data, field j of record i is stored in position [i][j] of the result as an Object of that type.
    Deprecated.
    Please use the getMetaData method to obtain this information
    int[]
    Deprecated.
    Please use the getMetaData method to obtain this information
    Get the original data
    final Object
    getObject(int col)
    Get the object at the specified col
    protected void
    init(String[] dataType, String[] fieldName, String[][] records)
    Initializes the DbData Object with data
    final boolean
    Go to the next row

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DbData

      protected DbData()
      Allocates a new DbData Object
    • DbData

      public DbData(String[] dataType, String[] fieldName, String[][] records) throws IllegalArgumentException
      Construct a new DbData class
      Parameters:
      dataType - an array of dataType specify by String. The following are valid data type recognize by the class.
      integer : "int", "integer", "smallint", tinyint" or "short"
      long : "long", "bigint"
      numeric : "numeric"
      decimal : "decimal"
      float : "float", "real"
      double : "double"
      time : "time"
      date : "date"
      timestamp : "timestamp"
      varchar : "string", "varchar"
      longvarchar : "longvarchar"
      boolean : "boolean", "logical", "bit"
      Data type names are case insensitive.
      fieldName - an array of name for each field in the record
      records - array of record, record[i] consists of array of size n where n = size of dataType = size of fieldName. Each field j in i, i.e. record[i][j] represent the data pass as string. The class will convert the string to appropriate data type. For null field value use set record to null If there is a size mismatch or invalid record entry that can't convert to destination data type, an IllegalArgumentException is thrown.
      Throws:
      IllegalArgumentException
    • DbData

      public DbData(String[] fieldName, Object[][] records) throws IllegalArgumentException
      Construct a new DbData class
      Parameters:
      fieldName - an array of name for each field in the record
      records - array of record, record[i] consists of array of size n where n = size of dataType = size of fieldName. Each field j in i, i.e. record[i][j] represent the data pass as string. The class will convert the string to appropriate data type. For null field value use set record to null If there is a size mismatch or invalid record entry that can't convert to destination data type, an IllegalArgumentException is thrown.
      Throws:
      IllegalArgumentException
    • DbData

      public DbData(String s) throws IllegalArgumentException
      Construct DbData by parsing the data value argument in HTML page
      Parameters:
      s - string value from the HTML page
      Throws:
      IllegalArgumentException
  • Method Details

    • init

      protected void init(String[] dataType, String[] fieldName, String[][] records) throws IllegalArgumentException
      Initializes the DbData Object with data
      Parameters:
      dataType - an array of dataType specify by String. The following are valid data type recognize by the class.
      integer : "int", "integer", "smallint", tinyint" or "short"
      long : "long", "bigint"
      numeric : "numeric"
      decimal : "decimal"
      float : "float", "real"
      double : "double"
      time : "time"
      date : "date"
      timestamp : "timestamp"
      varchar : "string", "varchar"
      longvarchar : "longvarchar"
      boolean : "boolean", "logical", "bit"
      Data type names are case insensitive.
      fieldName - an array of name for each field in the record
      records - array of record, record[i] consists of array of size n where n = size of dataType = size of fieldName. Each field j in i, i.e. record[i][j] represent the data pass as string. The class will convert the string to appropriate data type. For null field value use set record to null If there is a size mismatch or invalid record entry that can't convert to destination data type, an IllegalArgumentException is thrown.
      Throws:
      IllegalArgumentException
    • getColData

      public quadbase.reportdesigner.report.ColData[] getColData()
      For internal use only
    • getFieldName

      @Deprecated public String[] getFieldName()
      Deprecated.
      Please use the getMetaData method to obtain this information
      Get the field names for the data store in this class
      Returns:
      an array of field name
    • getFieldType

      @Deprecated public int[] getFieldType()
      Deprecated.
      Please use the getMetaData method to obtain this information
      Get the field data type for the data store in this class.
      Returns:
      an array of integer represent the field data type. The integer is defined in jdbc/Types.class
    • getData

      public Object[][] getData()
      Get the record data, field j of record i is stored in position [i][j] of the result as an Object of that type.
      Returns:
      2D array of record data.
    • next

      public final boolean next() throws Exception
      Go to the next row
      Specified by:
      next in interface IResultSet
      Throws:
      Exception
    • close

      public final void close() throws Exception
      For internal use only
      Specified by:
      close in interface IResultSet
      Throws:
      Exception
    • getMetaData

      public final IRSMetaData getMetaData() throws Exception
      Get the original data
      Specified by:
      getMetaData in interface IResultSet
      Throws:
      Exception
    • getObject

      public final Object getObject(int col) throws Exception
      Get the object at the specified col
      Specified by:
      getObject in interface IRow
      Parameters:
      col - The column number for the field, beginning with 1.
      Returns:
      The data value stored in that column field.
      Throws:
      Exception