SQLHDBC handle;
};
- struct ODBCStatement {
- ODBCStatement(SQLHSTMT statement) : handle(statement) {}
- ~ODBCStatement() {SQLFreeHandle(SQL_HANDLE_STMT,handle);}
- operator SQLHSTMT() {return handle;}
- SQLHSTMT handle;
- };
-
class ODBCStorageService : public StorageService
{
public:
pair<int,int> ODBCStorageService::getVersion(SQLHDBC conn)
{
// Grab the version number from the database.
- ODBCStatement stmt(getHSTMT(conn));
+ SQLHSTMT stmt = getHSTMT(conn);
SQLRETURN sr=SQLExecDirect(stmt, (SQLCHAR*)"SELECT major,minor FROM version", SQL_NTS);
if (!SQL_SUCCEEDED(sr)) {
// Get statement handle.
ODBCConn conn(getHDBC());
- ODBCStatement stmt(getHSTMT(conn));
+ SQLHSTMT stmt = getHSTMT(conn);
// Prepare and exectute insert statement.
//char *scontext = makeSafeSQL(context);
// Get statement handle.
ODBCConn conn(getHDBC());
- ODBCStatement stmt(getHSTMT(conn));
+ SQLHSTMT stmt = getHSTMT(conn);
// Prepare and exectute select statement.
char timebuf[32];
// Get statement handle.
ODBCConn conn(getHDBC());
- ODBCStatement stmt(getHSTMT(conn));
+ SQLHSTMT stmt = getHSTMT(conn);
// First, fetch the current version for later, which also ensures the record still exists.
char timebuf[32];
// Get statement handle.
ODBCConn conn(getHDBC());
- ODBCStatement stmt(getHSTMT(conn));
+ SQLHSTMT stmt = getHSTMT(conn);
// Prepare and execute delete statement.
char *scontext = makeSafeSQL(context);
// Get statement handle.
ODBCConn conn(getHDBC());
- ODBCStatement stmt(getHSTMT(conn));
+ SQLHSTMT stmt = getHSTMT(conn);
char timebuf[32];
timestampFromTime(expiration, timebuf);
// Get statement handle.
ODBCConn conn(getHDBC());
- ODBCStatement stmt(getHSTMT(conn));
+ SQLHSTMT stmt = getHSTMT(conn);
// Prepare and execute delete statement.
char nowbuf[32];
// Get statement handle.
ODBCConn conn(getHDBC());
- ODBCStatement stmt(getHSTMT(conn));
+ SQLHSTMT stmt = getHSTMT(conn);
// Prepare and execute delete statement.
char *scontext = makeSafeSQL(context);