2 // Description: Database Connection Handle manager.
7 // State's of Connection Handle.
10 C0
, // henv not allocated,hdbc not allocated
11 C1
, // henv allocated,hdbc not allocated
12 C2
, // henv allocated,hdbc allocated
13 C3
, // Connection function needs data
15 C5
, // Connected hdbc, allocated statement
16 C6
// Connected hdbc, Transaction in progress
21 CSqlOdbcDbc(void); // Should not create obj without using SQLAllocHandle
24 // Top 2 variable declaration should not be moved down.
25 int handleType_
; // Handle type.
26 CSqlOdbcError err_
; // Last error info.
28 DbcState_t state_
; // Environment State.
29 CSqlOdbcEnv
*parentEnv_
; // Parent Environment Handle.
30 List stmtList_
; // Statement handle list.
31 List descList_
; // Descriptor handle list.
32 AbsSqlConnection
*fsqlConn_
; // CSQL connection object
33 int mode_
; //1->csql , 2->gateway
34 SQLUINTEGER curAccessMode_
;
35 IsolationLevel curIsolationLevel_
;
37 // Connection Attributes
38 SQLUINTEGER accessMode_
; // Transaction access mode
39 // SQL_MODE_READ_ONLY OR
40 // SQL_MODE_READ_WRITE
42 IsolationLevel isolationLevel_
;// Transaction Isolation Level.
43 // SQL_TXN_READ_UNCOMMITTED
44 // SQL_TXN_READ_COMMITTED
45 // SQL_TXN_REPEATABLE_READ
46 // SQL_TXN_SERIALIZABLE
48 SQLUINTEGER autoCommit_
; // Automatically Commit after execution.
54 SQLRETURN
chkStateForSQLFreeHandle( void );
55 SQLRETURN
chkStateForSQLConnect( void );
56 SQLRETURN
chkStateForSQLDisconnect( void );
57 SQLRETURN
chkStateForSQLEndTran( void );
58 SQLRETURN
chkStateForSQLSetConnectAttr( void );
61 static SQLRETURN
SQLAllocHandle(
62 SQLHANDLE inputHandle
, // IN
63 SQLHANDLE
*outputHandle
);// OUT
65 static SQLRETURN
SQLFreeHandle(
66 SQLHANDLE inputHandle
); // IN
68 SQLRETURN
SQLConnect( // All param's are IN
76 SQLRETURN
SQLDisconnect();
79 SQLSMALLINT completionType
);// IN
81 SQLRETURN
SQLSetConnectAttr(
82 SQLINTEGER attribute
, // IN
83 SQLPOINTER value
, // IN
84 SQLINTEGER stringLength
); // IN
86 SQLRETURN
SQLGetConnectAttr(
87 SQLINTEGER attribute
, // IN
88 SQLPOINTER value
, // OUT
89 SQLINTEGER bufferLength
, // IN
90 SQLINTEGER
*stringLength
); // OUT
92 SQLRETURN
SQLGetFunctions(
93 SQLUSMALLINT FunctionId
,
94 SQLUSMALLINT
* SupportedPtr
99 SQLUSMALLINT InfoType
,
100 SQLPOINTER InfoValuePtr
,
101 SQLSMALLINT BufferLength
,
102 SQLSMALLINT
* StringLengthPtr
);
107 char *getFromUrl(char *url
,char *name
);
110 #endif // _ODBC_DBC_H_