Class DbData
java.lang.Object
quadbase.reportdesigner.ReportAPI.DbData
- All Implemented Interfaces:
IResultSet,IRow
- Direct Known Subclasses:
DbDataCollection
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
ConstructorsModifierConstructorDescriptionprotectedDbData()Allocates a new DbData ObjectConstruct DbData by parsing the data value argument in HTML pageConstruct a new DbData classConstruct a new DbData class -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()For internal use onlyquadbase.reportdesigner.report.ColData[]For internal use onlyObject[][]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.String[]Deprecated.Please use the getMetaData method to obtain this informationint[]Deprecated.Please use the getMetaData method to obtain this informationfinal IRSMetaDataGet the original datafinal ObjectgetObject(int col) Get the object at the specified colprotected voidInitializes the DbData Object with datafinal booleannext()Go to the next row
-
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 recordrecords- 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
Construct a new DbData class- Parameters:
fieldName- an array of name for each field in the recordrecords- 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
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 recordrecords- 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.Please use the getMetaData method to obtain this informationGet the field names for the data store in this class- Returns:
- an array of field name
-
getFieldType
Deprecated.Please use the getMetaData method to obtain this informationGet 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
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
Go to the next row- Specified by:
nextin interfaceIResultSet- Throws:
Exception
-
close
For internal use only- Specified by:
closein interfaceIResultSet- Throws:
Exception
-
getMetaData
Get the original data- Specified by:
getMetaDatain interfaceIResultSet- Throws:
Exception
-
getObject
Get the object at the specified col
-