![]() | 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
engineto indicate a particular DBMS. Most examples in the guide use a vendor name as the mnemonic, for examplesybaseororacle, but any character string that is not a keyword is valid. For a list of keywords, refer to Chapter 13, "Keywords in Database Drivers." Ifengineis already installed,dm_initreturns 0.support_function- One of the function names documented in the
dbiinit.cfile. The file name is usually in the formdm_vendorsupwherevendoris 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_liststructure indbiinit.cto initialize an engine at startup or else usedm_initto initialize an engine at a later point in the application.The
caseparameter specifies how Panther uses case to map column names to variables when executing aSELECTstatement. 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);