Initializes access to a specific database engine#include <dmuproto.h>int dm_init(char *engine, int support_function, int case, char *arg);
- 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 example
oracle, but any character string that is not a keyword is valid. For a list of keywords, refer to Chapter 13, "Keywords in Database Drivers." If
engineis already installed,
- One of the function names documented in the
dbiinit.cfile. The file name is usually in the form
vendoris an abbreviated vendor name. For example:dm_sybsup
- Sets the case processing for the specified engine. The constants are shown in Table 5-4 in Description.
- Reserved for future use. Set this parameter to 0.
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
dbiinit.cto initialize an engine at startup or else use
dm_initto initialize an engine at a later point in the application.
caseparameter specifies how Panther uses case to map column names to variables when executing a
SELECTstatement. Table 5-4 lists the available options.
Table 5-4 Database engine case constants
Use the case option set in the support function for that engine. For information on this setting, refer to the documentation for "Database Drivers."
Use case exactly as returned by the engine.
Force all column names returned by an engine to upper case. Therefore, the application should use upper case names for Panther variables.
Force all column names returned by an engine to lower case. Therefore, the application should use lower case names for Panther variables.
After the engine is initialized, the application can declare a connection on it.
retcode = dm_init("jdb", dm_jdbsup, DM_DEFAULT_CASE, 0);