borland Packages  Class Hierarchy  dx.dataset Package 

CoerceToListener interface

java.util.EventListener
   +----com.borland.dx.dataset.CoerceToListener

About the CoerceToListener interface

Methods  

If set, the CoerceToListener interface is called by implementors of Providers to coerce data from the data type of the data source to the data type of the Column component. It is used by QueryDataSet, ProcedureDataSet, QueryProvider and ProcedureProvider components. This allows an application to coerce column values from one data type to another as the values are sent to a data source, such as a JDBC driver.

Data types are automatically converted during the providing phase according to the table listed in Data type conversions during data providing. If you set a column's dataType property, thereby over-riding the default JDBC-to-com.borland mapping, automatic data type coercion is done. The exception to the automatic type coercion is when converting to and from a String to any data type other than String (and other conversions involving such differing data types). A VariantException is thrown in these cases.

To customize the coercion, or to prevent the VariantException from being thrown in cases as noted in the previous paragraph, wire the CoerceToListener.coerceToColumn(...) event.

See also: Data type conversion during resolving, CoerceFromListener.coerceFromColumn(...) event


CoerceToListener methods

Methods defined in this interface


CoerceToListener methods

coerceToColumn(com.borland.dx.dataset.StorageDataSet, com.borland.dx.dataset.Column, com.borland.dx.dataset.Variant, com.borland.dx.dataset.Variant)

  void coerceToColumn(StorageDataSet dataSet, Column column, Variant from, Variant to)
Allows an application to control the coercion of a data value from the data source to a column value in dataSet.

Parameters:

dataSet
The DataSet in which the Column exists.
Column
The name of the column in dataSet parameter.
from
The data value from the data source which needs to be coerced to the to parameter.
to
The column value that the from parameter must be coerced to.