mysql_connection.h | mysql_connection.h | |||
---|---|---|---|---|
/* | /* | |||
Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved . | Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved . | |||
The MySQL Connector/C++ is licensed under the terms of the GPLv2 | The MySQL Connector/C++ is licensed under the terms of the GPLv2 | |||
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most | <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most | |||
MySQL Connectors. There are special exceptions to the terms and | MySQL Connectors. There are special exceptions to the terms and | |||
conditions of the GPLv2 as it is applied to this software, see the | conditions of the GPLv2 as it is applied to this software, see the | |||
FLOSS License Exception | FLOSS License Exception | |||
<http://www.mysql.com/about/legal/licensing/foss-exception.html>. | <http://www.mysql.com/about/legal/licensing/foss-exception.html>. | |||
This program is free software; you can redistribute it and/or modify | This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published | it under the terms of the GNU General Public License as published | |||
skipping to change at line 30 | skipping to change at line 30 | |||
You should have received a copy of the GNU General Public License along | You should have received a copy of the GNU General Public License along | |||
with this program; if not, write to the Free Software Foundation, Inc., | with this program; if not, write to the Free Software Foundation, Inc., | |||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |||
*/ | */ | |||
#ifndef _MYSQL_CONNECTION_H_ | #ifndef _MYSQL_CONNECTION_H_ | |||
#define _MYSQL_CONNECTION_H_ | #define _MYSQL_CONNECTION_H_ | |||
#include <cppconn/connection.h> | #include <cppconn/connection.h> | |||
#include <boost/shared_ptr.hpp> | #include <boost/shared_ptr.hpp> | |||
#include <boost/scoped_ptr.hpp> | ||||
namespace sql | namespace sql | |||
{ | { | |||
namespace mysql | namespace mysql | |||
{ | { | |||
class MySQL_Savepoint : public sql::Savepoint | class MySQL_Savepoint : public sql::Savepoint | |||
{ | { | |||
sql::SQLString name; | sql::SQLString name; | |||
skipping to change at line 55 | skipping to change at line 56 | |||
sql::SQLString getSavepointName(); | sql::SQLString getSavepointName(); | |||
private: | private: | |||
/* Prevent use of these */ | /* Prevent use of these */ | |||
MySQL_Savepoint(const MySQL_Savepoint &); | MySQL_Savepoint(const MySQL_Savepoint &); | |||
void operator=(MySQL_Savepoint &); | void operator=(MySQL_Savepoint &); | |||
}; | }; | |||
class MySQL_DebugLogger; | class MySQL_DebugLogger; | |||
class MySQL_ConnectionData; /* PIMPL */ | struct MySQL_ConnectionData; /* PIMPL */ | |||
class MySQL_Statement; | ||||
namespace NativeAPI | namespace NativeAPI | |||
{ | { | |||
class NativeConnectionWrapper; | class NativeConnectionWrapper; | |||
} | } | |||
class CPPCONN_PUBLIC_FUNC MySQL_Connection : public sql::Connection | class CPPCONN_PUBLIC_FUNC MySQL_Connection : public sql::Connection | |||
{ | { | |||
MySQL_Statement * createServiceStmt(); | ||||
public: | public: | |||
MySQL_Connection(Driver * _driver, | MySQL_Connection(Driver * _driver, | |||
::sql::mysql::NativeAPI::NativeConne ctionWrapper & _proxy, | ::sql::mysql::NativeAPI::NativeConne ctionWrapper & _proxy, | |||
const sql::SQLString& hostName, | const sql::SQLString& hostName, | |||
const sql::SQLString& userName, | const sql::SQLString& userName, | |||
const sql::SQLString& password); | const sql::SQLString& password); | |||
MySQL_Connection(Driver * _driver, ::sql::mysql::NativeAPI::NativeCo nnectionWrapper & _proxy, | MySQL_Connection(Driver * _driver, ::sql::mysql::NativeAPI::NativeCo nnectionWrapper & _proxy, | |||
std::map< sql::SQLString, sql::Conne ctPropertyVal > & options); | std::map< sql::SQLString, sql::Conne ctPropertyVal > & options); | |||
skipping to change at line 152 | skipping to change at line 156 | |||
sql::Savepoint * setSavepoint(const sql::SQLString& name); | sql::Savepoint * setSavepoint(const sql::SQLString& name); | |||
void setTransactionIsolation(enum_transaction_isolation level); | void setTransactionIsolation(enum_transaction_isolation level); | |||
virtual sql::SQLString getSessionVariable(const sql::SQLString & var name); | virtual sql::SQLString getSessionVariable(const sql::SQLString & var name); | |||
virtual void setSessionVariable(const sql::SQLString & varname, cons t sql::SQLString & value); | virtual void setSessionVariable(const sql::SQLString & varname, cons t sql::SQLString & value); | |||
virtual sql::SQLString getLastStatementInfo(); | virtual sql::SQLString getLastStatementInfo(); | |||
protected: | private: | |||
/* We do not really think this class has to be subclassed*/ | ||||
void checkClosed(); | void checkClosed(); | |||
void init(std::map< sql::SQLString, sql::ConnectPropertyVal > & prop erties); | void init(std::map< sql::SQLString, sql::ConnectPropertyVal > & prop erties); | |||
Driver * driver; | Driver * driver; | |||
boost::shared_ptr< NativeAPI::NativeConnectionWrapper > proxy; | boost::shared_ptr< NativeAPI::NativeConnectionWrapper > proxy; | |||
/* statement handle to execute queries initiated by driver. Perhaps | ||||
it is | ||||
a good idea to move it to a separate helper class */ | ||||
boost::scoped_ptr< ::sql::mysql::MySQL_Statement > service; | ||||
MySQL_ConnectionData * intern; /* pimpl */ | MySQL_ConnectionData * intern; /* pimpl */ | |||
private: | ||||
/* Prevent use of these */ | /* Prevent use of these */ | |||
MySQL_Connection(const MySQL_Connection &); | MySQL_Connection(const MySQL_Connection &); | |||
void operator=(MySQL_Connection &); | void operator=(MySQL_Connection &); | |||
}; | }; | |||
} /* namespace mysql */ | } /* namespace mysql */ | |||
} /* namespace sql */ | } /* namespace sql */ | |||
#endif // _MYSQL_CONNECTION_H_ | #endif // _MYSQL_CONNECTION_H_ | |||
End of changes. 7 change blocks. | ||||
4 lines changed or deleted | 13 lines changed or added | |||