DSIDataEngine Class Reference

This is a sample implementation of IDataEngine. More...

Inherits Simba::DSI::IDataEngine.

Inherited by DSIExtSqlDataEngine.

List of all members.

Public Member Functions

 DSIDataEngine (Simba::DSI::IStatement *in_statement)
 Constructor.
ILoggerGetLog ()
 Return the logger from the parent statement.
bool IsODBC2 () const
 Get whether or not the SQL_ATTR_ODBC_VERSION environment variable is ODBC 2.x.
virtual Simba::DSI::IResultMakeNewMetadataResult (Simba::DSI::DSIMetadataTableID in_metadataTableID, const std::vector< Variant > &in_filterValues, const simba_wstring &in_escapeChar, const simba_wstring &in_identifierQuoteChar, bool in_filterAsIdentifier)
 Makes a new IResult* which contains a metadata data source and filters to filter out rows in the metadata table that are not needed.
virtual
Simba::DSI::DSIMetadataSource
MakeNewMetadataTable (Simba::DSI::DSIMetadataTableID in_metadataTableID, Simba::DSI::DSIMetadataRestrictions &in_restrictions, const simba_wstring &in_escapeChar, const simba_wstring &in_identifierQuoteChar, bool in_filterAsIdentifier)=0
 Makes a new metadata source that contains raw metadata.
virtual void SetDirectExecute ()
 Indicate that any queries prepared by this data engine will be executed immediately, and only once.
virtual ~DSIDataEngine ()
 Destructor.

Protected Member Functions

IResultAdaptResultForAPI (simba_uint32 in_accessAPI, DSIMetadataTableID in_metadataTableID, const std::vector< Variant > &in_unmappedFilterValues, AutoPtr< IResult > in_result)
 Helper function to adapt the FilteredMetadataResult IResults based on the API in use.
virtual Simba::DSI::IResultGetMetadataResultImplementation (Simba::DSI::DSIMetadataTableID in_metadataTableID, Simba::DSI::DSIMetadataRestrictions &in_restrictions, Simba::DSI::DSIMetadataSource *in_metadataSource, std::vector< Simba::DSI::DSIOutputMetadataColumn * > &in_columnMetadata, std::vector< Simba::DSI::DSIMetadataFilter * > &in_filters)
 Returns a concrete implementation of metadata resultset.
virtual bool IsODBCVersion3 ()
 Get whether or not the SQL_ATTR_ODBC_VERSION environment variable is ODBC 3.x.
bool IsOLEDB () const
 Get whether the value of DSI_ENV_DATA_ACCESS_API in the parent environment is DSI_DAA_OLE_DB (i.e, whether this code is running in the context of an OLE DB provider.
const std::vector< VariantMapTypeValuesIfNecessary (const std::vector< Variant > &in_filterValues, simba_int32 in_accessAPI)
 Helper function that maps ODBC 3.x SQL types to ODBC 2.x SQL types and vice versa.
bool ShouldPerformFiltering () const
 Determine if the SDK should perform metadata source filtering if using the default metadata source implementation.

Protected Attributes

const simba_int32 m_dataAccessAPI
bool m_isDirectExecute
Simba::DSI::IStatementm_statement

Detailed Description

This is a sample implementation of IDataEngine.

Only MakeNewMetadataResult is implemented here and this class's existence is to make creating metadata results easier.


Constructor & Destructor Documentation

DSIDataEngine ( Simba::DSI::IStatement in_statement  ) 

Constructor.

Parameters:
in_statement Parent statement. (NOT OWN)
virtual ~DSIDataEngine (  )  [virtual]

Destructor.


Member Function Documentation

IResult* AdaptResultForAPI ( simba_uint32  in_accessAPI,
DSIMetadataTableID  in_metadataTableID,
const std::vector< Variant > &  in_unmappedFilterValues,
AutoPtr< IResult in_result 
) [protected]

Helper function to adapt the FilteredMetadataResult IResults based on the API in use.

Parameters:
in_statement Statement for this DataEngine. (NOT OWN)
in_metadataTableID ID of the metadata being adapted.
in_unmappedFilterValues The original filter values if needed for the adapter.
in_result The result to adapt. (OWN)
Returns:
The adapted result. (OWN)
ILogger* GetLog (  ) 

Return the logger from the parent statement.

Returns:
The logger from the parent statement.
virtual Simba::DSI::IResult* GetMetadataResultImplementation ( Simba::DSI::DSIMetadataTableID  in_metadataTableID,
Simba::DSI::DSIMetadataRestrictions in_restrictions,
Simba::DSI::DSIMetadataSource in_metadataSource,
std::vector< Simba::DSI::DSIOutputMetadataColumn * > &  in_columnMetadata,
std::vector< Simba::DSI::DSIMetadataFilter * > &  in_filters 
) [protected, virtual]

Returns a concrete implementation of metadata resultset.

This basic implementation return new instance of BasicFilteredMetadataResult().

MAINTENANCE NOTE: The DSIOutputMetadataColumn*s, and DSIMetadataFilter*s in in_columnMetadata and in_filters, respectively, are NOT OWNed by this function. When this function creates a new FilteredMetadataResult, the FilteredMetadataResult assumes ownership of these objects by calling vector::swap. The caller of this function is responsible for cleaning any objects in the case of an error.

Parameters:
in_metadataTableID Identifier to create the appropriate metadata table
in_restrictions Restrictions that may be applied to the metadata table. Some restrictions may not be passed to the DSII if there are wildcards. The wildcards are '_' for a single character and '' for multiple characters. These are not passed down to avoid problems with filtering the wildcards literally, and are instead handled by the SDK. Note that if you wish to have full filtering, please refer to DSI_FILTER_METADATA_SOURCE.
in_metadataSource Metadata source that contains raw metadata.
in_columnMetadata List of columns based on the metadata table ID. (NOT OWN).
in_filters A list of metadata filters used to determine which rows are needed in retrieving data. (NOT OWN)
Returns:
IResult reference that has concrete implementation of metadata resultset. (OWN)
bool IsODBC2 (  )  const [inline]

Get whether or not the SQL_ATTR_ODBC_VERSION environment variable is ODBC 2.x.

virtual bool IsODBCVersion3 (  )  [protected, virtual]

Get whether or not the SQL_ATTR_ODBC_VERSION environment variable is ODBC 3.x.

It is ODBC 2.x if the value of this variable is SQL_OV_ODBC2. It is ODBC 3.x if the value is SQL_OV_ODBC3. The ODBC application is responsible for setting this environment attribute prior to allocating a connection to this driver.

Returns:
True if the version is ODBC 3.x; false if it is ODBC 2.x
bool IsOLEDB (  )  const [protected]

Get whether the value of DSI_ENV_DATA_ACCESS_API in the parent environment is DSI_DAA_OLE_DB (i.e, whether this code is running in the context of an OLE DB provider.

virtual Simba::DSI::IResult* MakeNewMetadataResult ( Simba::DSI::DSIMetadataTableID  in_metadataTableID,
const std::vector< Variant > &  in_filterValues,
const simba_wstring in_escapeChar,
const simba_wstring in_identifierQuoteChar,
bool  in_filterAsIdentifier 
) [virtual]

Makes a new IResult* which contains a metadata data source and filters to filter out rows in the metadata table that are not needed.

Parameters:
in_metadataTableID Identifier to create the appropriate metadata table.
in_filterValues Filters to be applied to the metadata table. These filters are passed in by the application that calls the catalog function and cannot be modified. For example, the catalog function "SQLTables" contains the arguments "CatalogName", "SchemaName", "TableName", and "TableType". These arguments are extracted to the in_filterValues vector. While these values cannot be modified, if the CatalogName is NULL, the current catalog name is used.
in_escapeChar Escape character used in filtering.
in_identifierQuoteChar Quote identifier, which is the quotation mark that this filter recognizes.
in_filterAsIdentifier Indicates if string filters are treated as identifiers. If in_metadataID is true, string filters are treated as identifiers. Otherwise, filters are not treated as identifiers.
Returns:
New IResult reference that contains a metadata data source and filters out data not needed. (OWN)

Implements IDataEngine.

virtual Simba::DSI::DSIMetadataSource* MakeNewMetadataTable ( Simba::DSI::DSIMetadataTableID  in_metadataTableID,
Simba::DSI::DSIMetadataRestrictions in_restrictions,
const simba_wstring in_escapeChar,
const simba_wstring in_identifierQuoteChar,
bool  in_filterAsIdentifier 
) [pure virtual]

Makes a new metadata source that contains raw metadata.

A map of column tags to literal string restrictions will be passed into the metadata source, which enables the metadata source cut down on the size or the raw table.

If SDK metadata filtering is enabled (via the DSI_FILTER_METADATA_SOURCE driver property), then the passed in restrictions are only a suggestion for the metadata source, in order to allow it to restrict what it returns before SDK filtering is performed.

Note that wildcard restrictions will _not_ be passed down when SDK metadata filtering is enabled as they require more involved filtering. If wildcard filters can be handled by the data source, they can be passed down by setting the IDriver property DSI_FILTER_METADATA_SOURCE to DSI_FMS_FALSE, in which case the SDK will do no filtering of the results and pass all the restrictions. When this is done, your DSII will be responsible for correctly filtering and returning the results.

Parameters:
in_metadataTableID Identifier to create the appropriate metadata table
in_restrictions Restrictions that may be applied to the metadata table. Some restrictions may not be passed to the DSII if there are wildcards. The wildcards are '_' for a single character and '' for multiple characters. These are not passed down to avoid problems with filtering the wildcards literally, and are instead handled by the SDK. Note that if you wish to have full filtering, please refer to DSI_FILTER_METADATA_SOURCE.
in_escapeChar Escape character used in filtering.
in_identifierQuoteChar Quote identifier, which is the quotation mark that this filter recognizes.
in_filterAsIdentifier Indicates if string filters are treated as identifiers. If in_filterAsIdentifier is true, string filters are treated as identifiers. Otherwise, filters are not treated as identifiers.
Returns:
New metadata source that contains raw metadata, or NULL if not supported. (OWN)

Implemented in DSIExtSqlDataEngine.

const std::vector<Variant> MapTypeValuesIfNecessary ( const std::vector< Variant > &  in_filterValues,
simba_int32  in_accessAPI 
) [protected]

Helper function that maps ODBC 3.x SQL types to ODBC 2.x SQL types and vice versa.

If the SQL_ATTR_ODBC_VERSION environment attribute indicates that the ODBC version is 2.x, then the 3.x type should be mapped to the corresponding 2.x type. The ODBC 3.x driver manager will map a 2.x type to a 3.x type if the driver ODBC version is 3.x. See http://msdn.microsoft.com/en-us/library/ms714714(VS.85).aspx and http://msdn.microsoft.com/en-us/library/ms712408(VS.85).aspx for more information.

Parameters:
in_filterValues The SQL data type values.
in_accessAPI The DSI_ENV_DATA_ACCESS_API that values are mapped for.
Returns:
Vector containing the original variant filter values. Only values that needed to be mapped will be modified in this vector.
virtual void SetDirectExecute (  )  [virtual]

Indicate that any queries prepared by this data engine will be executed immediately, and only once.

If this function is not called, then the prepared query may be executed multiple times.

If not needed, this hint can be safely ignored.

Implements IDataEngine.

bool ShouldPerformFiltering (  )  const [protected]

Determine if the SDK should perform metadata source filtering if using the default metadata source implementation.

Returns:
True if the SDK should perform filtering; false otherwise.

Member Data Documentation

const simba_int32 m_dataAccessAPI [protected]
bool m_isDirectExecute [protected]

The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:15 2017 for SimbaEngine 10.1.3.1011 by simba