|
1 #include <sqlcli1.h> |
|
2 #include <sqlutil.h> |
|
3 #include <sqlenv.h> |
|
4 #include <dbd/common.h> |
|
5 |
|
6 #define DBD_DB2_CONNECTION "DBD.DB2.Connection" |
|
7 #define DBD_DB2_STATEMENT "DBD.DB2.Statement" |
|
8 |
|
9 /* |
|
10 * result set metadata |
|
11 */ |
|
12 |
|
13 typedef struct _resultset { |
|
14 SQLSMALLINT name_len; |
|
15 SQLSMALLINT type; |
|
16 SQLUINTEGER size; |
|
17 SQLSMALLINT scale; |
|
18 SQLCHAR name[32]; |
|
19 } resultset_t; |
|
20 |
|
21 /* |
|
22 * bind parameters |
|
23 */ |
|
24 typedef struct _bindparams { |
|
25 SQLCHAR *buffer; |
|
26 SQLINTEGER len; |
|
27 SQLINTEGER buffer_len; |
|
28 } bindparams_t; |
|
29 |
|
30 /* |
|
31 * connection object implentation |
|
32 */ |
|
33 typedef struct _connection { |
|
34 SQLHANDLE env; |
|
35 SQLHANDLE db2; |
|
36 } connection_t; |
|
37 |
|
38 /* |
|
39 * statement object implementation |
|
40 */ |
|
41 typedef struct _statement { |
|
42 resultset_t * resultset; |
|
43 bindparams_t * bind; |
|
44 SQLSMALLINT num_result_columns; /* variable for SQLNumResultCols */ |
|
45 |
|
46 SQLHANDLE stmt; |
|
47 SQLHANDLE db2; |
|
48 } statement_t; |
|
49 |