diff options
author | hillj <hillj@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-01-04 16:48:19 +0000 |
---|---|---|
committer | hillj <hillj@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-01-04 16:48:19 +0000 |
commit | 42027bd2d6791868acb6b1ddb547c4593eed4aee (patch) | |
tree | 92dc9eab39bbcc8a57c8f99de034e8b222bef4fd /ADBC | |
parent | f4175f2ced09c63a18832b7ca9ebd8b0cf8c575f (diff) | |
download | ATCD-42027bd2d6791868acb6b1ddb547c4593eed4aee.tar.gz |
Mon Jan 4 16:47:56 UTC 2010 James H. Hill <hillj at cs dot iupui dot edu>
Diffstat (limited to 'ADBC')
-rw-r--r-- | ADBC/ChangeLog | 6 | ||||
-rw-r--r-- | ADBC/adbc/ODBC/ODBC.h | 42 |
2 files changed, 48 insertions, 0 deletions
diff --git a/ADBC/ChangeLog b/ADBC/ChangeLog index a70829f0e29..cce8a5ecfbb 100644 --- a/ADBC/ChangeLog +++ b/ADBC/ChangeLog @@ -1,3 +1,9 @@ +Mon Jan 4 16:47:56 UTC 2010 James H. Hill <hillj at cs dot iupui dot edu> + + * adbc/ODBC/ODBC.h: + + Missing file. + Mon Jan 4 16:46:22 UTC 2010 James H. Hill <hillj at cs dot iupui dot edu> * adbc/config.h: diff --git a/ADBC/adbc/ODBC/ODBC.h b/ADBC/adbc/ODBC/ODBC.h new file mode 100644 index 00000000000..b40e7e583d1 --- /dev/null +++ b/ADBC/adbc/ODBC/ODBC.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ODBC.h + * + * $Id$ + * + * @author James H. Hill + */ +//============================================================================= + +#ifndef _ADBC_ODBC_H_ +#define _ADBC_ODBC_H_ + +#include "adbc/config.h" +#include "ODBC_export.h" + +#if defined (WIN32) +#include <windows.h> +#endif + +// SQL headers +#include <sql.h> +#include <sqlext.h> +#include <sqltypes.h> +#include <odbcinst.h> + +/// Determine if the return value from a SQL* method is +/// a successful code. +#define SQL_SUCCEED(res) ((res == SQL_SUCCESS_WITH_INFO) || (res == SQL_SUCCESS)) + +/// Verify an SQL operation succeeds. If it does not, then we +/// throw the specified exception. +#define SQL_VERIFY(op, ex) \ + do { \ + SQLRETURN __return__ = op; \ + if (!SQL_SUCCEED (__return__)) \ + throw ex; \ + } while (0) + +#endif // !defined _ADBC_ODBC_H_ |