summaryrefslogtreecommitdiff
path: root/libodbcpp/odbc-command.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-24 04:08:56 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-12-24 04:08:56 +0000
commit63d9cbb434ec4f6e828083b99d638127cfce7a95 (patch)
tree2dfcf95372467a9119147265fccfba058c617b8a /libodbcpp/odbc-command.h
parentUse parent glibmm (diff)
downloadlibdbpp-odbc-63d9cbb434ec4f6e828083b99d638127cfce7a95.tar.bz2
libdbpp-odbc-63d9cbb434ec4f6e828083b99d638127cfce7a95.tar.xz
libdbpp-odbc-63d9cbb434ec4f6e828083b99d638127cfce7a95.zip
ODBC files prefixed with odbc-
Diffstat (limited to 'libodbcpp/odbc-command.h')
-rw-r--r--libodbcpp/odbc-command.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/libodbcpp/odbc-command.h b/libodbcpp/odbc-command.h
new file mode 100644
index 0000000..d7173e3
--- /dev/null
+++ b/libodbcpp/odbc-command.h
@@ -0,0 +1,52 @@
+#ifndef ODBC_COMMAND_H
+#define ODBC_COMMAND_H
+
+#include <command.h>
+#include <vector>
+#include "odbc-connection.h"
+#include <glibmm/ustring.h>
+
+namespace ODBC {
+ class Param;
+ class Command : public virtual DB::Command {
+ typedef std::vector<Param*> Params;
+ public:
+ Command(const Connection &, const std::string & sql);
+ virtual ~Command() = 0;
+
+ void bindParamI(unsigned int i, int val);
+ void bindParamI(unsigned int i, long val);
+ void bindParamI(unsigned int i, long long val);
+ void bindParamI(unsigned int i, unsigned int val);
+ void bindParamI(unsigned int i, unsigned long int val);
+ void bindParamI(unsigned int i, unsigned long long int val);
+
+ void bindParamB(unsigned int i, bool val);
+
+ void bindParamF(unsigned int i, double val);
+ void bindParamF(unsigned int i, float val);
+
+ void bindParamS(unsigned int i, const Glib::ustring &);
+
+ void bindParamT(unsigned int i, const boost::posix_time::time_duration &);
+ void bindParamT(unsigned int i, const boost::posix_time::ptime &);
+
+ void bindNull(unsigned int i);
+
+ protected:
+ friend class Param;
+ friend class Column;
+ SQLHSTMT hStmt;
+ const Connection& connection;
+ private:
+ Params params;
+
+ template <class ParamType>
+ ParamType *
+ makeParam(unsigned int idx);
+ };
+
+}
+
+#endif
+