2 ** NetXMS - Network Management System
3 ** Copyright (C) 2003-2012 Victor Kirhenshtein
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU Lesser General Public License as published by
7 ** the Free Software Foundation; either version 3 of the License, or
8 ** (at your option) any later version.
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
15 ** You should have received a copy of the GNU Lesser General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <nms_common.h>
31 #define DBDRV_API_VERSION 19
39 #define __EXPORT __declspec(dllexport)
44 #define DECLARE_DRIVER_HEADER(name) \
45 extern "C" int EXPORT drvAPIVersion; \
46 extern "C" const char EXPORT *drvName; \
47 int EXPORT drvAPIVersion = DBDRV_API_VERSION; \
48 const char EXPORT *drvName = name;
57 #define DBDRV_MAX_ERROR_TEXT 1024
64 typedef void * DBDRV_CONNECTION
;
65 typedef void * DBDRV_STATEMENT
;
66 typedef void * DBDRV_RESULT
;
67 typedef void * DBDRV_UNBUFFERED_RESULT
;
74 #define DBERR_SUCCESS 0
75 #define DBERR_CONNECTION_LOST 1
76 #define DBERR_INVALID_HANDLE 2
77 #define DBERR_OTHER_ERROR 255
81 // DB binding buffer allocation types
84 #define DB_BIND_STATIC 0 // buffer is managed by caller and will be valid until after the query is executed
85 #define DB_BIND_TRANSIENT 1 // buffer will be duplicated by DB driver in DBBind()
86 #define DB_BIND_DYNAMIC 2 // DB Driver will call free() on buffer
90 // C and SQL types for parameter binding
93 #define DB_CTYPE_STRING 0
94 #define DB_CTYPE_INT32 1
95 #define DB_CTYPE_UINT32 2
96 #define DB_CTYPE_INT64 3
97 #define DB_CTYPE_UINT64 4
98 #define DB_CTYPE_DOUBLE 5
99 #define DB_CTYPE_UTF8_STRING 6
101 #define DB_SQLTYPE_VARCHAR 0
102 #define DB_SQLTYPE_INTEGER 1
103 #define DB_SQLTYPE_BIGINT 2
104 #define DB_SQLTYPE_DOUBLE 3
105 #define DB_SQLTYPE_TEXT 4
108 * DBIsTableExist return codes
112 DBIsTableExist_Failure
= -1,
113 DBIsTableExist_NotFound
= 0,
114 DBIsTableExist_Found
= 1
117 #endif /* _dbdrv_h_ */