jdbc resultset and odbc parameter fixes for non cache table on Date, Time ,TimeStamp...
[csql.git] / src / odbc / odbcCommon.h
blob3211b06ea827b15f64d0dc72297ec9f5dac1c96f
1 #ifndef _ODBC_COMMON_H_
2 #define _ODBC_COMMON_H_
4 //#define DEBUG 1
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <vector>
11 // SQL Standard headers
12 #include <sqlext.h>
14 // SQLAPI Interface
15 #include <AbsSqlStatement.h>
16 #include <Table.h>
18 // Forward Declaration
19 class CSqlOdbcEnv;
20 class CSqlOdbcDbc;
21 class CSqlOdbcStmt;
22 class CSqlOdbcDesc;
24 // ODBC internal headers
25 #include "odbcError.h"
26 #include "odbcEnv.h"
27 #include "odbcDbc.h"
28 #include "odbcDesc.h"
29 #include "odbcStmt.h"
31 // There is not equivalent mode in CSQL, should confirm. ??
32 #define ACCESSMODE_READ_ONLY 0
33 #define ACCESSMODE_READ_WRITE 1
35 // Is handle valid ?
36 SQLRETURN isValidHandle( SQLHANDLE hnd, SQLSMALLINT handleType );
38 // Is C type valid/supported ?
39 SQLRETURN isValidCType( SQLSMALLINT type );
41 // Is SQL type valid/supported ?
42 SQLRETURN isValidSQLType( SQLSMALLINT type );
44 // Type conversion functions
45 void copyFromOdbc(AbsSqlStatement *stmt, int paramNo, SQLUINTEGER destLen,
46 void *odbcData, SQLUINTEGER odbcLen, SQLSMALLINT type);
47 void convertFromOdbc(DataType srcType, void *src, DataType destType, void *dest,int length=0, TDBInfo tdbname=mysql);
48 void convertToStringFromOdbc(void* dest, void* src, DataType srcType, int length=0, TDBInfo tdbname=mysql );
49 SQLINTEGER copyToOdbc(void *odbcData, SQLUINTEGER odbcLen,
50 void *sourceData, SQLUINTEGER sourceLen,SQLSMALLINT type,SQLSMALLINT apptype);
52 void getInputBuffer(void **buffer,SQLSMALLINT type,SQLUINTEGER length);
54 DataType getCSqlType( SQLSMALLINT type );
56 SQLSMALLINT getSQLType( DataType type );
58 SQLCHAR *getSQLTypeName( SQLSMALLINT type );
59 bool isFunctionSupports(SQLUSMALLINT type);
60 #endif