Data Access Builder Mini Samples
Objective
The objective of these samples is to help you use the Data Access
Builder and write C++ applications using its generated classes.
You may also want to refer to the Data Access Class Library and
Generated Code for additional information on writing your own
applications. The information in this section describes the
objective of each Data Access sample, how to run the provided
executable, and how to create a mapping for the sample.
Information on importing the sample into a project in the IDE,
building it, and running it is provided in a readme file in the
samples source code directory.
Before Using the Samples
Preparation for Samples
contains setup and reference information you should read before
starting to run or build the samples.
Data Access Samples
These samples are C++ batch applications. Each sample
demonstrates how to create Data Access Builder mappings and and
how to write C++ programs that use the generated classes. Unless
otherwise stated, the samples are written to access your choice
of sample databases (DB2 or dBase). For information on setting up
these sample databases, see Preparation
for Samples.
The following samples are provided:
- Sample: Map a Table and Use Add,
Retrieve, Update, Delete Methods (application name
arud)
- Create a simple mapping for a database table.
- Write a program that uses the generated methods
add, retrieve, update, and delete to manipulate
rows.
- Sample: Map a Table and Retrieve
Rows from a Result Set (application name curfetch)
- Create a simple mapping for a database table.
- Write a program that uses the generated methods
fetchNext and element to process a returned
result set.
- Sample: Map a Table Join and
Retrieve Rows from The Result Set (application name
tabljoin)
- Create a simple mapping for a table join.
- Write a program that uses the generated methods
fetchNext and element to process a result set.
- Sample: Map a Table and Retrieve
Rows from a Result Set Using a Collection
(application name fill)
- Create a simple mapping for a database table.
- Write a program that uses the generated method
fill to process a result set using a collection.
- Sample: Map a Table and Use
DataIdManager Class To Retrieve Data ID Result Set
(application name giflist)
- DB2 only
- Create a simple mapping for a database table.
- Write a program that uses the DataIdManager class
to retrieve rows from a result set of Data IDs.
- Sample: Create and Use a
User-Defined Method With SQL Predicate (application
name udmsqlpr)
- Create a simple mapping for a database table.
- Add a user-defined method with a SQL predicate to
the mapping.
- Write a program that uses the generated methods
open<UDM>, fetchNext. and
element to process a result set.
- Sample: Create and Use a
User-Defined Method With Customized SQL Statement
(application name udmcsql)
- Create a simple mapping for a database table.
- Add a user-defined method with a customized SQL
statement to the mapping.
- Write a program that uses the generated
user-defined method to perform a function on the
table rows and return a value.
- Sample: Create and Use a Stored
Procedure Call on a Persistent Object (application
name udmspcpo)
- DB2 only
- Create a simple mapping for a database table.
- Define the prototype of a stored procedure that
exists on the database to Data Access Builder.
- Add a stored procedure call method to the Data
Access Builder mapping.
- Write a program that uses the generated stored
procedure call method to run the stored procedure
on the database and return a value.
- Sample: Access a Large Object and
Write It to a File (application name gifget)
- DB2 only
- Create a simple mapping for a database table.
- Write a program that accesses a row containing a
GIF large object, and writes it to an output
file.
Visual Sample
The Data Access Builder samples also includes a sample that
demonstrates how Data Access classes can be used as visual parts,
and built into an application by using the Visual Builder
component of C++. Information on generating code for the sample
and building the application with the Visual Builder is in Sample: Use the Generated Code with the
Visual Builder.

Data Access Builder
Data Access Builder
Workflow
User-Defined Methods
Table Joins and Query
Support

Data Access Class Library
and Generated Class Reference