borland Packages Class Hierarchy dx.dataset Package
java.lang.Object +----com.borland.dx.dataset.ReadRow +----com.borland.dx.dataset.ReadWriteRow +----com.borland.dx.dataset.ParameterRow
Constructors Properties Methods
Implements ColumnDesigner, Designable, Serializable
The ParameterRow
component is useful when working with parameter values for SQL statements of QueryDataSet
and ProcedureDataSet
components. To use this component in your application
ParameterRow
Column
components
Column
properties you need
parameterRow
property of the QueryDataSet
or ProcedureDataSet
to this ParameterRow
Parameters can also be specified using a "scoped" DataRow
that contains only some of the Columns
in the associated DataSet
. However, the Column
components in the DataRow
map directly to the Columns
in the DataSet
, and therefore do not allow more than once reference in the DataRow
.
The ParameterRow
component allows you to specify the same column multiple times, for example, for range comparisons.
For example, you may want to specify query parameters which involve two or more range comparisons against the same Column
. For the following query statement:
SELECT * FROM employee WHERE emp_no>=:LOW AND emp_no<=:HIGH
your ParameterRow
should have a Column
for each of its parameter names, :LOW and :HIGH. Place values you want the query to use in these Columns
and associate them to the query (set the parameterRow
property of the QueryDataSet
or ProcedureDataSet
to this ParameterRow
. In this way, whenever you execute your query, you can use different values for :LOW and :HIGH without having to write multiple queries for each permutation.
For a tutorial and more information on using parameterized queries in your application, see "Using parameterized queries to obtain data from your database" in the Database Application Developer's Guide.
public ParameterRow()Default constructor that creates a
ParameterRow
component.
public Column[] getColumns() public void setColumns(Column[] columns)Stores the
Column
components as a String
array of Column
names. Used by the JBuilder design tools.
public int addColumn(Column column, int parameterType)Adds the specified
Column
to the ParameterRow
, sets its parameterType
as specified, then returns the ordinal position of the newly added Column
.
This method is a shortcut for setting the parameterType
property on a Column
and then calling the addColumn(Column)
method.
On error this method throws a DataSetException
.
column
Column
component to add to this ParameterRow
.
parameterType
ParameterType
variables.
public void addColumn(String columnName, int dataType)Adds a
Column
to the ParameterRow
, sets its columnName
as specified, and its dataType
to ParameterType.IN
.
This method is useful for parameterized queries and is a short-cut to calling other addColumn(...)
methods then setting the parameterType
to ParameterType.IN
.
On error, this method throws a DataSetException
.
columnName
Column
component (specified by its String name) to add to this ParameterRow
.
dataType
com.borland.dx.dataset.Variant
variables.
public void addColumn(String columnName, int dataType, int parameterType)Adds a
Column
to the ParameterRow
, then sets its columnName
, dataType
,
and parameterType
properties as specified by its parameters.
On error, this method throws a DataSetException
.
columnName
Column
component (specified by its String name) to add to this ParameterRow
.
dataType
com.borland.dx.dataset.Variant
variables.
parameterType
ParameterType
variables.