Custom properties can be added to
Statement objects. These properties allow you to customize how your connection and statement objects behave.
Before you can implement custom properties for your connection and statement attributes, you should request and reserve a value for each attribute from the Open Group. This ensures that no two drivers will assign the same integer value to different custom attributes. If you do not reserve a unique attribute or use one that is already in use, your driver may experience compatibility issues with any application that uses the conflicting custom attributes for other drivers.
For more information on requesting a value from the Open Group, refer to the Driver-Specific Data Types, Descriptor Types, Information Types, Diagnostic Types, and Attributes section of the MSDN ODBC Programmer’s Reference.
You must define keys for each of the custom
Statement properties or attributes for which you would like to add support. For each custom key, create a
Simba::Support::AttributeData* to store data for the property or attribute. Use a map to map keys to their corresponding
AttributeData*. For more information on creating a custom key refer to the
DSIStmtProperties.h header files in the folder
To add custom connection and statement properties, implement the following methods in your
In this function, check if the provided key corresponds with one of the standard ODBC properties. Return
false if it does not;
To see the list of keys for ODBC properties, see the
Simba::DSI::DSIStmtPropertyKey enum or the
Simba::DSI::DSIConnPropertyKey DSIConnPropertyKey enum in the C++ API reference. Go to SimbaEngine C++ API Reference, select the Namespaces tab, select Simba::DSI, then search for DSIConnPropertyKey.
In this function, set an
AttributeData* for the custom property key. In your implementation, check to ensure the provided key corresponds to a custom property or attribute. If it does not, an appropriate error or exception should be thrown and logged.
This function retrieves the
AttributeData* associated with a custom key. In your implementation, check to ensure the provided key corresponds to a custom property or attribute.
This function retrieves the data type associated with the custom property or attribute. Data types are defined in the
Simba::Support::AttributeType enum, located in the header folder
Custom properties can be added to the drivers using the Java DSI with either the JNI DSI API, or the SimbaJDBC component. When using the JNI DSI API, custom properties are accessed in the same way that custom properties are accessed for ODBC drivers. When using the SimbaJDBC component, the custom properties are exposed through the following custom extensions to the
Retrieve a custom property identified by the integer key.
Set a custom property identified by the integer key.
Because these are custom extensions, applications will have to be coded to explicitly use these functions.
Custom properties can be added to drivers using the DotNet DSI, but can only be directly accessed when using the CLI DSI to build an ODBC driver.