]>
Commit | Line | Data |
---|---|---|
7e616b10 RR |
1 | #ifndef _HDBC_H |
2 | #define _HDBC_H | |
1a6944fd | 3 | |
7e616b10 | 4 | typedef struct DBC |
1a6944fd | 5 | { |
7e616b10 RR |
6 | int type; /* must be 1st field */ |
7 | struct DBC FAR* | |
8 | next; | |
1a6944fd | 9 | |
7e616b10 | 10 | HENV genv; /* back point to global env object */ |
1a6944fd | 11 | |
7e616b10 RR |
12 | HDBC dhdbc; /* driver's private dbc */ |
13 | HENV henv; /* back point to instant env object */ | |
14 | HSTMT hstmt; /* list of statement object handle(s) */ | |
15 | HERR herr; | |
1a6944fd | 16 | |
7e616b10 | 17 | int state; |
1a6944fd | 18 | |
7e616b10 RR |
19 | /* options */ |
20 | UDWORD access_mode; | |
21 | UDWORD autocommit; | |
1a6944fd | 22 | |
7e616b10 RR |
23 | UDWORD login_timeout; |
24 | UDWORD odbc_cursors; | |
25 | UDWORD packet_size; | |
26 | UDWORD quiet_mode; | |
27 | UDWORD txn_isolation; | |
28 | SWORD cb_commit; | |
29 | SWORD cb_rollback; | |
1a6944fd | 30 | |
7e616b10 RR |
31 | char FAR* |
32 | current_qualifier; | |
1a6944fd | 33 | |
7e616b10 RR |
34 | int trace; /* trace flag */ |
35 | char FAR* | |
36 | tfile; | |
37 | void FAR* | |
38 | tstm; /* trace stream */ | |
1a6944fd RR |
39 | } DBC_t; |
40 | ||
7e616b10 | 41 | /* |
1a6944fd | 42 | * Note: |
7e616b10 RR |
43 | * - ODBC applications can see address of driver manager's |
44 | * connection object, i.e connection handle -- a void pointer, | |
45 | * but not detail of it. ODBC applications can neither see | |
1a6944fd RR |
46 | * detail driver's connection object nor its address. |
47 | * | |
48 | * - ODBC driver manager knows its own connection objects and | |
49 | * exposes their address to an ODBC application. Driver manager | |
50 | * also knows address of driver's connection objects and keeps | |
51 | * it via dhdbc field in driver manager's connection object. | |
7e616b10 | 52 | * |
1a6944fd RR |
53 | * - ODBC driver exposes address of its own connection object to |
54 | * driver manager without detail. | |
55 | * | |
56 | * - Applications can get driver's connection object handle by | |
57 | * SQLGetInfo() with fInfoType equals to SQL_DRIVER_HDBC. | |
58 | */ | |
59 | ||
7e616b10 RR |
60 | enum { |
61 | en_dbc_allocated, | |
62 | en_dbc_needdata, | |
63 | en_dbc_connected, | |
64 | en_dbc_hstmt | |
1a6944fd RR |
65 | }; |
66 | ||
67 | #endif |