summaryrefslogtreecommitdiff
path: root/libodbcpp/command.h
blob: 9da291c852c3ad89dfb7d758ac6568d41073093c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef ODBC_COMMAND_H
#define ODBC_COMMAND_H

#include <vector>
#include "connection.h"
#include "timetypepair.h"

namespace ODBC {
	class Param;
	class Command {
			typedef std::vector<Param*> Params;
		public:
			Command(const Connection&, String sql);
			virtual ~Command() = 0;

			void				bindParamI(unsigned int i, int val);
			void				bindParamI(unsigned int i, long val);
			void				bindParamI(unsigned int i, unsigned int val);
			void				bindParamI(unsigned int i, long unsigned int val);
			void				bindParamI(unsigned int i, long long unsigned int val);
			void				bindParamF(unsigned int i, double val);
			void				bindParamF(unsigned int i, float val);
			void				bindParamS(unsigned int i, const char *);
			void				bindParamS(unsigned int i, const unsigned char *);
			void				bindParamS(unsigned int i, const unsigned char *, size_t);
			void				bindParamS(unsigned int i, std::string);
			void				bindParamS(unsigned int i, String);
			void				bindParamT(unsigned int i, struct tm *);
			void				bindParamT(unsigned int i, time_t);
			void				bindParamT(unsigned int i, const TimeTypePair & p) { bindParamT(i, p.c()); }

			const String		sql;
		protected:
			friend class BindBase;
			SQLHSTMT        	hStmt;
			const Connection&	connection;
		private:
			Params				params;
	};

}

#endif