diff options
author | James H. Hill <hilljh82@gmail.com> | 2010-01-04 16:48:19 +0000 |
---|---|---|
committer | James H. Hill <hilljh82@gmail.com> | 2010-01-04 16:48:19 +0000 |
commit | 621b01c980e80bfc1f7cfa080521ade25ba77ac0 (patch) | |
tree | 92dc9eab39bbcc8a57c8f99de034e8b222bef4fd | |
parent | 92f001df733888ec086917804bdf00e81c9ffda4 (diff) | |
download | ATCD-621b01c980e80bfc1f7cfa080521ade25ba77ac0.tar.gz |
Mon Jan 4 16:47:56 UTC 2010 James H. Hill <hillj at cs dot iupui dot edu>
-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_ |