IBM Books

Image, Audio, and Video Extenders Administration and Programming


Sample programs

A number of files comprise the sample programs for the DB2 extenders. The files are:

File
Description

enable.c
Enables a database for the Audio, Image, and Video Extenders, creates a table, and enables the table and its columns.

populate.c
Imports data into the table (the program is in C format)

Populate.java
Imports data into the table (the program is in Java format)

query.c
Queries the data in the table (the program is in C format)

Query.java
Queries the data in the table (the program is in Java format)

api.c
Uses extender APIs to query the database

handle.c
Demonstrates the use of handles in UDFs and how to make where clause comparisons in SELECT statements

qbcatdmo.c
Creates a QBIC catalog and catalogs a column of images into the catalog

qbicdemo.c
Queries a QBIC catalog

color.c
Makes color table declarations for qbicdemo.c

QbicQry.java
Presents average color and histogram color selectors for a QBIC query

makesf.c
Creates a shot catalog file for use with makehtml.exe.

makehtml.c
Accesses a shot catalog and creates HTML pages for display by a Web browser

storybrd.java
Applet to display the shots, called by the HTML pages generated by makehtml.c

utility.c
Utility routines

utility.h
Header file for utility routines

makefile.aix
Makefile to build the programs in AIX

makefile.os2
Makefile to build the programs in OS/2

makefile.iva
Makefile to build the programs in Windows NT (or later), using IBM VisualAge C++

makefile.mvc
Makefile to build the programs in Windows, using Microsoft Visual C++

makefile.sun
Makefile to build the programs in Solaris

makefile.hp
Makefile to build the programs in HP-UX

Executable files are provided for the following sample programs. The sample programs are intended to be run in the order that is shown.

  1. Enable
  2. Populate
  3. Query
  4. API
  5. Handle
  6. Qbcatdmo
  7. Qbicdemo
  8. QbicQry
  9. Makesf
  10. Makehtml

Executable class files (Populate.class, Query.class, QbicQry.class, and storybrd.class) are provided with the sample Java programs.

Prior to running the sample programs, you must create a database on your server. The extender services must have also been started on the server. To run a sample program, type the program name (this starts the program's executable file). You will be prompted for the database name, user ID, and password. Use the user ID and password of the user that created the database.

You can also build your own executable files for the sample programs. To do that, you need to:

  1. Copy the sample program files to a writable directory.
  2. Edit the makefile to specify the locations on your system where DB2, the extenders, and the compiler are installed.
  3. Use make or nmake to compile the files into executable programs.

For further information about installing and using the sample programs, see the README.CNT file in the sample programs directory.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]