Programming Guide |
Initializes access to a specific database engine
#include <dmuproto.h>int dm_init(char *engine, int support_function, int case, char *arg);
engine
- A name you assign to the engine. If an application uses two or more engines, the application uses the mnemonic
engine
to indicate a particular DBMS. Most examples in the guide use a vendor name as the mnemonic, for examplesybase
ororacle
, but any character string that is not a keyword is valid. For a list of keywords, refer to Chapter 13, "Keywords in Database Drivers." Ifengine
is already installed,dm_init
returns 0.support_function
- One of the function names documented in the
dbiinit.c
file. The file name is usually in the formdm_
vendor
sup
wherevendor
is an abbreviated vendor name. For example:dm_sybsup
dm_orasup
dm_intsupcase
- Sets the case processing for the specified engine. The constants are shown in Table 5-4 in Description.
arg
- Reserved for future use. Set this parameter to 0.
C only
- · 0: Success.
Before an application can access a database, Panther must perform an engine initialization. The initialization adds the engine name to the list of available engines, allocates a data structure for the engine, calls the engine's support function to initialize the data structure, and sets case handling for the engine. You can use the
vendor_list
structure indbiinit.c
to initialize an engine at startup or else usedm_init
to initialize an engine at a later point in the application.The
case
parameter specifies how Panther uses case to map column names to variables when executing aSELECT
statement. Table 5-4 lists the available options.
After the engine is initialized, the application can declare a connection on it.
#include <dmerror.h>
#include <smusrdbi.h>
int retcode;
retcode = dm_init("jdb", dm_jdbsup, DM_DEFAULT_CASE, 0);