Database Component Framework

The Allaire Database Component Framework (DCF) is a collection of Java™ classes that provide a simple interface for reading and requesting database records into a Java applet or application. The data collection mechanisms of the DCF allow customers to connect DCF-aware components together with Cold Fusion™ and other Web technologies to create sophisticated Web services without the hassle of low-level programming. In addition, the library is an open standard for third-party software developers to build stand-alone, Cold Fusion-enabled Java applets quickly.

This reference is intended for software developers who want to use the Allaire Database Component Framework in their own applets. Familiarity with Java is assumed. If you aren't a Java programmer there are many places on the Web devoted to it. Sun's Java Tutorial is one of them.

The Allaire DCF library contains a framework for retrieving recordsets from the web server and for operations with recordsets. All Allaire applets use the framework, so it is necessary to install it in the public web server directory. Mapping to this directory is usually named "/classes/" and contains all Java components necessary for serving applets. If you do not have this directory, create the sub-directory "classes" in your web serverís root document directory. If you want to install Java components in a different directory, map "/classes/" to this directory and insure that the web server has access to it. If your server is serving multiple domains you must map "/classes/" for each domain which will use Java applets.

Unzip files from the file into the directory described above, using the -d switch to restore the directory structure. Note that some older unzipping utilities will strip the names of the classes from ".class" to ".cla". If this happens the applets will not work. Make sure they unzip with the full ".class", or rename all the classes after they have unzipped.

Using the DCF
A Java applet can utilize the Allaire Database Component Framework to receive recordsets in two ways:

  1. PARAM Initialization. Upon construction the applet can read data specified in an HTML page by PARAM elements within the APPLET tag. This happens only once during initialization of the applet. This initialization is accomplished by constructing an AppletParamRecordset object.

  2. URL Requests. During execution the applet can request data from a URL and read a recordset identified in the data returned. Unlike the initialization technique, this method can be used multiple times during the lifetime of an applet's execution. The request is made by passing a URL to the Query constructor and calling the execute method.

In either case the DCF will need to be given names for each column and a name to associate with each recordset if there are multiple recordsets. The getColumnNames, getRowCount, and getData methods can be used on the resulting recordset(s) to obtain the data.

Class Reference

  • Recordset - A container of cells organized by rows and columns.
  • AppletParamRecordset - Initializes a recordset with applet parameters.
  • Query - Requests data from a URL and populates recordsets with the results.

    The DCF Interface

  • Overview
  • Initializing a Recordset by Column
  • Initializing a Recordset by Cell
  • Initializing Multiple Recordsets
  • Requesting Recordsets at Runtime

    Beta 1 Release Notes
    All the DCF class reference files (those found in the Docs directory) should be copied into the directory where you keep the Java SDK reference. All graphics found in the Images subdirectory should be copied to the Java SDK reference subdirectory of the same name.

    CASE-SENSITIVITY - Java is case-sensitive. Thus,

    <PARAM NAME="Columns" VALUE="ID,Height,Weight">
    is not the same as
    <PARAM NAME="COLUMNS" VALUE="ID,Height,Weight">
    In the event that an expected parameter or keyword (e.g. "Columns" or "Recordset") is not found, the AppletParamRecordset will attempt to look for simple case variations (e.g., "Columns", "COLUMNS", and "columns"), but exhaustive case checking (2^NameLength attempts) is not performed.

    URL ENCODING - Text should be URL encoded if it is going to be used in a list of columns or rows. The Cold Fusion function, URLEncodedFormat(), is designed for such use. If the data is not URL encoded, and it contains non-alphanumeric data, the DCF might not interpret the results correctly.

    NULLS - Null and empty items should be sent as empty strings enclosed within single quotes. For example:

    instead of the unquoted version:

    Resources at Allaire
  • Documentation addendum
  • The Cold Fusion Developer's Forum
  • Technical Support for Registered and Evaluation Users
  • Allaire Sales

  • Copyright © 1996 Allaire Corp. All rights reserved.

    No part or contents of these documents may be reproduced nor transmitted in any form nor by any means without the express written permission of the publisher.

    Cold Fusion is a trademark of Allaire Corp. Java is a trademark of Sun Microsystems, Inc. Other trademarks belong to their respective owners.