Component /dat/lib/database/dbCursor

DbCursor provides cursor styled access to data within a database. A dbCursor must be custom configured with an document type, database mapping, and database access information. Once configured, the dbCursor will fetch, insert, update, and delete documents of the document type to and from the database.

Documents are fetched using dbCursor find port. On receipt of document on this port, dbCursor will begin a query for documents having the same element and attribute values as the input document. The first document satisfying the query will be retrieved and retained in variable contained within the dbCursor. The fetched document and or any element or attribute within the document can be accessed using output data ports on the contained variable.

Cursor movement to the next or previous document is performed using the next and previous pins.

Documents are updated by replacing the values of elements and attributes within the contained variable and then using the save pin. Values for elements and attributes are updated using input data ports on the contained variable.

Documents are inserted into the database by first using the clear pin, then enter new values to the elements and attributes of the contained variable, and lastly using the save pin.

Documents are deleted by fetching the desired document to be deleted and then using the delete pin.

In order to work correctly, a dbCursor must be configured with a document type, database mapping, and database connection information.

Configuring a dbCursor with a document type is accoumplished by dragging the document type from the component tree and dropping it over the dbCursor or over the dbCursor's editor.

Database access information is configured by entering values into the dsn, userName, and password properties. This maybe performed on the dbCursor or in its editor.

Database mapping is configured by opening dbCursors component editor. Once the database access information is entered, the left part of the dbCursor's editor will display the tables and columns found within the schema of the database. Database mapping is added by drap and drop of a columns from the data base tree over an element or attribute within the document type.

Pins

Ports

Properties

Copyright 2000,2001 Data Access Technologies