2
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; version 2 of the
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21
#ifndef _RECORDSET_CDBC_STORAGE_BE_H_
22
#define _RECORDSET_CDBC_STORAGE_BE_H_
25
#include "wbpublic_public_interface.h"
26
#include "sqlide/recordset_sql_storage.h"
30
class WBPUBLICBACKEND_PUBLIC_FUNC Recordset_cdbc_storage : public Recordset_sql_storage
33
typedef boost::shared_ptr<Recordset_cdbc_storage> Ref;
34
static Ref create(bec::GRTManager *grtm) { return Ref(new Recordset_cdbc_storage(grtm)); }
35
virtual ~Recordset_cdbc_storage();
37
Recordset_cdbc_storage(bec::GRTManager *grtm);
40
virtual void do_unserialize(Recordset *recordset, sqlite::connection *data_swap_db);
41
virtual void do_fetch_blob_value(Recordset *recordset, sqlite::connection *data_swap_db, RowId rowid, ColumnId column, sqlite::Variant &blob_value);
44
virtual void run_sql_script(const Sql_script &sql_script);
47
std::string decorated_sql_query(); // adds limit clause if defined by options
50
void dbms_conn(const sql::Dbc_connection_handler::Ref &val) { _dbms_conn= val; }
51
sql::Dbc_connection_handler::Ref dbms_conn() { return _dbms_conn; }
52
void dbc_resultset(boost::shared_ptr<sql::ResultSet>& value) { _dbc_resultset= value; }
53
void dbc_statement(boost::shared_ptr<sql::Statement>& value) { _dbc_statement= value; }
54
bool reloadable() const { return _reloadable; }
55
void reloadable(bool val) { _reloadable= val; }
57
sql::Dbc_connection_handler::ConnectionRef dbms_conn_ref();
59
sql::Dbc_connection_handler::Ref _dbms_conn;
60
boost::shared_ptr<sql::ResultSet> _dbc_resultset; // for 1-time unserialization
61
boost::shared_ptr<sql::Statement> _dbc_statement; // for 1-time unserialization
62
bool _reloadable; // whether can be reloaded using stored sql query
66
#endif /* _RECORDSET_CDBC_STORAGE_BE_H_ */