Prerequisites for the Sample Programs

This page describes the pre-requisites required to run the sample programs. The SAMPLE PROGRAMS section contains a suite of sample programs grouped by programming language and data access interface. The programs are located in subdirectories under the quickstart/sample_code directory.

A number of scripts are available to set up the database, user accounts, and program run time environment. Follow the steps below to get started:

1. Run the build_sampledb script

Run the quickstart/sample_scripts/createdb/build_sampledb script, which creates the sample database and user accounts that are used by the sample programs. This script creates the TimesTen user accounts and prompts you for the desired user passwords.

Windows: > cd quickstart/sample_scripts/createdb
> build_sampledb.bat
   
Unix / Linux: $ cd quickstart/sample_scripts/createdb
$ ./build_sampledb.sh

Note: To reset the sample program environment, re-run the build_sampledb script.

User Accounts: The build_sampledb script creates the following TimesTen database users:

ADM This user is the administrator of the sample database. ADM can perform administrative tasks such as create new user accounts and backing up the database.
APPUSER APPUSER is the default application user for the sample programs. This user owns all the database objects required by the sample programs.
XLAUSER XLAUSER is used in the XLA sample programs to subscribe to database changes.

Database Objects: The following database objects are created under APPUSER:
TABLES ABC
ACCOUNT
ACTION
BINS
CUSTOMER
DATA_TABLE
DEPT
EMP
EMP_UNIQUE_ID_
ICF
INVENTORY
INVENTORY2
JOURNAL
MYDATA
MYTABLE
NUM1_TAB
NUM2_TAB
ORDERS
ORDER_ITEM
PRODUCT
PURCHASE_RECORD
RATIO
RESULT_TABLE
SUM_TAB
TEMP
XLAPERSISTENT_TABLE
PACKAGES EMP_PKG
PERSONNEL
SAMPLE_PKG
PROCEDURES GETEMPNAME_UNIQUE_ID_
GETEMPNO_UNIQUE_ID_
FUNCTION SP
SEQUENCES ACCT_SEQUENCE
CUSTID
ORDERID
PRODUCTID

All sample programs run against the sampledb_1121 database using a default user appuser, unless specified explicitly at the command line. The sample database must be created before any sample programs can be run.

2. Set up the program environment for compilation and execution

To set up the environment to compile and execute the sample programs, run the ttquickstartenv script in the quickstart directory. Run this script each time you starts a new terminal or command prompt session, where you want to compile and run any of the sample programs.

Windows:   > quickstart/ttquickstartenv.bat
Unix/Linux:   $ . quickstart/ttquickstartenv.sh OR source quickstart/ttquickstartenv.csh

3. Compile and run the sample programs

For information on how to compile and run the sample programs, see the README file in each directory. In addition, each Sample Programs page in Quick Start has a Compile and Run link, which provides examples on how to run the sample programs.

Now you are ready to select sample programs available for the API of your choice, either from the links on the left navigation menu or SAMPLE PROGRAMS