OTX-Runtime for C++  
ISqlImplementation.h
1 #ifndef OpenTestSystem_Otx_Runtime_Api_Custom_ISqlImplementation_H
2 #define OpenTestSystem_Otx_Runtime_Api_Custom_ISqlImplementation_H
3 
4 #include "ApiDefs.h"
5 #include <string>
6 #include <list>
7 #include <memory>
8 #include <map>
9 
10 namespace OpenTestSystem { namespace Otx { namespace Runtime { namespace Api { namespace Custom { namespace SqlImplementation {
11  class IConnection;
12  class IResultSet;
13 }}}}}}
14 
15 namespace OpenTestSystem { namespace Otx { namespace Runtime { namespace Api { namespace DataTypes {
16  class Object;
17  class ByteField;
18 }}}}}
19 
20 namespace OpenTestSystem { namespace Otx { namespace Runtime { namespace Api {
21  class IRuntimeContext;
22 }}}}
23 
24 namespace OpenTestSystem {
25  namespace Otx {
26  namespace Runtime {
27  namespace Api {
28  namespace Custom {
32  class API_EXPORTS ISqlImplementation {
33  public:
34  virtual ~ISqlImplementation() {}
35 
45  virtual void CreateConnection(std::shared_ptr<IRuntimeContext> runtimeContext, std::shared_ptr<SqlImplementation::IConnection> connection, std::string connectionString) = 0;
46 
51  virtual void CloseConnection(std::shared_ptr<SqlImplementation::IConnection> connection) = 0;
52 
59  virtual void ExecuteQuery(std::shared_ptr<SqlImplementation::IConnection> connection, std::shared_ptr<SqlImplementation::IResultSet> resultSet, std::string statement) = 0;
60 
70  virtual int ExecuteUpdate(std::shared_ptr<SqlImplementation::IConnection> connection, std::string statement) = 0;
71 
80  virtual bool GetResultValueAsBoolean(std::shared_ptr<SqlImplementation::IResultSet> resultSet, std::shared_ptr<DataTypes::Object> column) = 0;
81 
90  virtual std::shared_ptr<DataTypes::ByteField> GetResultValueAsByteField(std::shared_ptr<SqlImplementation::IResultSet> resultSet, std::shared_ptr<DataTypes::Object> column) = 0;
91 
100  virtual double GetResultValueAsFloat(std::shared_ptr<SqlImplementation::IResultSet> resultSet, std::shared_ptr<DataTypes::Object> column) = 0;
101 
110  virtual int GetResultValueAsInteger(std::shared_ptr<SqlImplementation::IResultSet> resultSet, std::shared_ptr<DataTypes::Object> column) = 0;
111 
120  virtual std::string GetResultValueAsString(std::shared_ptr<SqlImplementation::IResultSet> resultSet, std::shared_ptr<DataTypes::Object> column) = 0;
121 
127  virtual bool NextResult(std::shared_ptr<SqlImplementation::IResultSet> resultSet) = 0;
128  };
129  }
130  }
131  }
132  }
133 }
134 
135 #endif
Allows users to implement their own Sql extension.
Definition: ISqlImplementation.h:32
virtual void ExecuteQuery(std::shared_ptr< SqlImplementation::IConnection > connection, std::shared_ptr< SqlImplementation::IResultSet > resultSet, std::string statement)=0
Executes the given SQL statement
virtual std::shared_ptr< DataTypes::ByteField > GetResultValueAsByteField(std::shared_ptr< SqlImplementation::IResultSet > resultSet, std::shared_ptr< DataTypes::Object > column)=0
Get the value form ResultSet as ByteField type
virtual bool NextResult(std::shared_ptr< SqlImplementation::IResultSet > resultSet)=0
Move the cursor forward one row
virtual void CreateConnection(std::shared_ptr< IRuntimeContext > runtimeContext, std::shared_ptr< SqlImplementation::IConnection > connection, std::string connectionString)=0
Open a connection
virtual std::string GetResultValueAsString(std::shared_ptr< SqlImplementation::IResultSet > resultSet, std::shared_ptr< DataTypes::Object > column)=0
Get the value form ResultSet as String type
virtual void CloseConnection(std::shared_ptr< SqlImplementation::IConnection > connection)=0
Closes the current connection
virtual bool GetResultValueAsBoolean(std::shared_ptr< SqlImplementation::IResultSet > resultSet, std::shared_ptr< DataTypes::Object > column)=0
Get the value form ResultSet as Boolean type
virtual int ExecuteUpdate(std::shared_ptr< SqlImplementation::IConnection > connection, std::string statement)=0
Executes the given SQL statement
virtual double GetResultValueAsFloat(std::shared_ptr< SqlImplementation::IResultSet > resultSet, std::shared_ptr< DataTypes::Object > column)=0
Get the value form ResultSet as Float type
virtual int GetResultValueAsInteger(std::shared_ptr< SqlImplementation::IResultSet > resultSet, std::shared_ptr< DataTypes::Object > column)=0
Get the value form ResultSet as Integer type
Represents an OTX Connection.
Definition: IConnection.h:17
Represents an OTX ResultSet.
Definition: IResultSet.h:11
Namespace containing all objects related to testing inside automotive industry