[View INPRISE Home Page][View Product List][Search This Web Site][View Available Downloads][Get Free INPRISE Membership][Enter Discussion Area][Send Email To Webmaster]


JBuilder
 Developer Support
 Newsgroups
 Case Studies
 White Papers
 In the News
 Books
 Product Manuals
 Press Releases
 Previous Versions

INPRISE
 About INPRISE
 Corporate Info
 World Wide
 Where to Buy
 Developer Support
 Professional
     Services

 Product Manuals
 Case Studies
 Tech Corner
 Books
 Events & Seminars
 Customer Service
 User Groups
 Year 2000
 INPRISE Jobs
 Pressroom

Programs
 Education
 Certification
 Product Training
 ESP Program
 Support Programs
 Resellers


DataExpress Technology Overview
by Steven Shaughnessy


7. Multi-threaded access.

This practice should be avoided because it increases the possibility of deadlock.

8. DataSets and data-aware controls.

9. Calculated Column Support.

10. Data types.

    The DataExpress type system maps JDBC types to the Variant type system. Variant is a class which has static identifiers that enumerate the data types supported. For the most part, the mapping is 1 to 1. The mapping is documented, but there are notable exceptions. JDBC has 3 floating point types: REAL, FLOAT, and DOUBLE. But JDBC returns the values for these types as either a Java float (REAL) or Java double (FLOAT, DOUBLE). This is a bit strange. Variant supports a Java float (Variant.FLOAT) and the Java double (Variant.DOUBLE). JDBC REAL is mapped to Variant.FLOAT. JDBC FLOAT and DOUBLE are mapped to Variant.DOUBLE.

    The Java BigDecimal is used by JDBC and Variant to store fixed point arbitrary precision numeric values. There is extensive control over rounding with this data type, but operations on them are slow and they require much more memory than a double.

    The Java InputStream is used by JDBC and Variant to store binary data types. By default, data-aware controls assume that binary data values are images like .gif or .jpeg files that can be displayed. There is a quirk with InputStreams. They can optionally support mark() and reset() methods. If reset is not supported, the stream can only be read once. This makes things difficult to paint or save binary values. One way to work around this problem is to copy a one pass InputStream into another type of InputStream (i.e. ByteArrayInputStream) that supports reset.

    The DataExpress architecture makes extensive use of Variant for internal purposes. Although Variant is surfaced in some of the public methods of DataExpress components, most applications don't have to use Variants. There is an extra step to using a Variant because a Variant must be allocated before a public method can be called with it. Variants can be useful when you want to pass arbitrary data values across API layers.

    Variant also supports two null states: Variant.ASSIGNED_NULL and Variant.UNASSIGNED_NULL. This differentiation is useful if a DataSet is resolved back to a JDBC connection. If a value is Variant.UNASSIGNED_NULL, new rows will be inserted without specifying the values for the columns that are set to Variant.UNASSIGNED_NULL. This causes many servers to fill in default values for these columns. If the value for a column is Variant.ASSIGNED_NULL, then new rows will be inserted, specifying that the values of these columns should be set to null. If a row is added without setting column values, they automatically get stored to the DataSet as Variant.UNASSIGNED_NULL.

11. Editing Constraints

12. Import/export with the DataFile interface.

The dataset package has a simple Datafile interface for import/exporting data to and from a DataSet. Currently, the only implementor of this provided by JBCL is a TextDataFile that can be used to import/export text files with delimiters and optional separators.

The DataExpress type system maps JDBC types to the Variant type system. Variant is a class which has static int identifiers that enumerate the data types supported. For the most part the mapping is 1 to 1. The mapping is documented, but there are notable exceptions. JDBC has 3 floating point types: REAL, FLOAT, and DOUBLE. But JDBC returns the values for these types as either a Java float (REAL) or Java double (FLOAT, DOUBLE). This is a bit strange. Variant supports a Java float (Variant.FLOAT) and the Java double (Variant.DOUBLE). JDBC REAL is mapped to Variant.FLOAT. JDBC FLOAT and DOUBLE are mapped to Variant.DOUBLE.

The Java BigDecimal is used by JDBC and Variant to store fixed point arbitrary precision numeric values. There is extensive control over rounding with this data type, but operations on them are slow and they require much more memory than a double.

The Java InputStream is used by JDBC and Variant to store binary data types. By default data aware controls assume that binary data values are images like .gif or .jpeg files that can be displayed. There is a quirk with InputStreams. The can optionally support mark() and reset() methods. If reset is not supported, the stream can only be read once. This makes things difficult to paint or save binary values. One way to work around this problem is to copy a one pass InputStream into another type of InputStream (i.e. ByteArrayInputStream) that supports reset.

13. Internationalization.

DataExpress components are completely internationalized. Sorting and comparison operations use the JavaSoft collation support. Import/Export using TextDataFiles use the multibyte encoding support for non-U.S. locales. Default formatting and parsing use the patterns described by the Locale.

14. Performance.

The DataExpress components are designed to be performant. For client/server applications, the performance characteristics of the JDBC driver, network, and SQL server used will determine a large part of an application's performance.

Here are some suggestions that may help:

15. Third-party opportunities.

Here is a summary of third party opportunities.Most of these have already been discussed.

    1) DataSet aware custom editors and painters for JBCL model-view-item controls (GridControl, ListControl, FieldControl, and TreeControl). By implementing the borland.jbcl.model.ItemEditor/ItemPainter interfaces, third parties can create ready-made editors and/or painter components that can be set on the Column.ItemEditor/ItemPainter property. This plumbing could be used to provide custom pick list, lookup, or check box behavior. Note that when wired to a Column.ItemEditor/Itempainter, the "Object" properties passed in ItemEditor/ItemPainter are actually borland.jbcl.dataset.ColumnVariants. ColumnVariants store the value and the associated Column and dataSet. The Column component could be used to obtain the Column.PickListDescriptor property for use by a custom pick list control.

    2) StorageDataSet.Resolver property. Custom resolver components can be developed. For JDBC-specific resolvers, the SQLResolver interface should be implemented.

    3) Replacement components for the SQLResolutionManager could be developed for more custom multi-table resolutions. Currently, there is only a SQLResolutionManager for JDBC data sources. Custom ones could be built for applications that require custom transaction management, nested transactions, distributed transaction, or TP monitor support.

    4) Custom DataSet data providers to load data from non-JDBC data sources. There are some "load" methods off of StorageDataSet that can be used to load rows with a RowStatus.LOADED row status. Rows with a RowStatus.LOADED row status are not considered as rows that need to be "inserted" at resolution time. The row loading methods are higher performance, but more error-prone methods to use than the normal row inserting and adding methods of DataSet.

    5) Import/Export engines. There is a DataFile interface for saving/loading DataSets. Currently there is only one implementation of this: TextDatafile. More implementations could be developed for other file formats like Paradox, dBase, Access, FoxPro, Quattro Pro, Excel, etc..

    Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Borland International, Inc. is independent of Sun Microsystems, Inc.

Back To Top
Home Page
 
Trademarks & Copyright © 1998 INPRISE Corporation.