home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
DATABASE
/
STOCK
/
SOM
/
README
< prev
next >
Wrap
Text File
|
1995-06-11
|
5KB
|
132 lines
NAME: Data Access SOM Stock Sample
FEATURES/CONCEPTS:
This sample illustrates how to use the Data Access Builder Class Library and the code generated by the
Data Access Builder Tool to access DB2/2 database tables in a SOM C++ program. It shows how to connect
to a database, manipulate data, make transactions, and disconnect from a database.
TASK:
A simple SOM C++ program that updates stock inventory and received order information that are kept
in two DB2/2 database tables and generates a price list from it.
DESCRIPTION:
This sample program generates a price list from the initial data. It then adds more rows
to the inventory and receivedorder tables, calculates the new values and then
updates the tables. It then generates an updated price list.
PROJECT LOCATION:
To locate the SOM folder:open the SAMPLES folder, then the DATABASE folder, then the
STOCK folder.
SOURCE FILE LOCATION:
X:\ibmcpp\samples\database\stock\som
where X: is the drive you installed the samples and document component of VisualAge C++.
HOW TO RUN THE SAMPLE
NOTE: You must have started the DB2/2 database manager and logged on before you can run the
sample.
FROM THE WORKFRAME ENVIRONMENT:
- Double-click on the DAX SOM Stock Sample icon to open the project view
of the sample. If you have not already done so, install the database -- double-click on the
SETUPDB.CMD to install the database for the first time, otherwise double-click on RESETDB.cmd
to re-initialize the database. Click on the RUN button of the project's toolbar.
FROM THE COMMAND LINE:
- from the X:\ibmcpp\samples\database\stock\som directory, if you are installing the
database for the first time, type:
SETUPDB.CMD
otherwise, type:
RESETDB.CMD
- then type the name of the executable file&colon.
CLIENT
HOW TO BUILD THE SAMPLE PROJECT YOURSELF:
FROM THE COMMAND LINE:
Note: You must have started the DB2/2 database manager and logged on before you can build the
sample.
1) Generate the C++ usage bindings of the IDL version of the Data Access builder C++ classes. Change to
\ibmcpp\include directory, and type:
sc -sxh *.idl
2) Change to the X:\ibmcpp\samples\database\stock\som directory.
If you are installing the database of this sample for the first time, type:
SETUPDB
Otherwise, type:
RESETDB
3)Start the Data Access Builder by typing:
ICSDATA BRCHTWO.DAX
brchtwo.dax is a prebuilt file which contains the mapping between the database tables and the classes.
4) Click Mouse Button 2 on each of the class icons (blue balls) in turn, select GENERATE ->PARTS
for each from the pop-up menu. Close the Data Access Builder session.
5) To build the executable, type
NMAKE /F BINDINGS.MAK
BUILD
6) To run the application, type:
CLIENT
SOFTWARE/HARDWARE PREREQUISITES:
- IBM VisualAge C++ , including Data Access Builder with SOM
- DB2/2 V1.2.0
- OS/2 2.1 or Warp
- Minimum : IBM or compatible 386
Recommended : IBM or compatible 486 and up
FILE NAME(S) DESCRIPTION
============ ===========
SETUPDB.CMD This file creates the BrchTwo database and populates
inventory and receivedorder tables.
RESETDB.CMD This file re-initializes the two tables back to the
initial setting (intended for use after running the
sample application).
BUILD.CMD This file builds the sample application.
CLIENT.CPP The file is the client application that uses the
Store Class.
CLIENT.CPP The file is the client application that uses the
Data Access Builder Class Library and the generated
IDL classes to access the database tables.
BrchTwo.DAX This is the saved session from the generations of the
BrchTwo classes using the Data Access Builder Tool. It
contains the mapping between the two database tables and
the generated classes. User can use the mapping in this
file to regenerate the database classes.
README This file.
CLIENT.EXE The application.
INVENTOV.BND Bind files produced by SQLPREP when CLIENT.EXE was built.
PRCLISTV.BND They are used to bind the CLIENT.EXE application to the
RECEIVEV.BND database built with SETUPDB.CMD.
BINDINGS.MAK Makefile to generate bindings from the generated IDL
for use with this CPP sample application.