Programmer Guide : solidDB® ODBC API : solidDB® extensions for ODBC API
  
solidDB® extensions for ODBC API
The solidDB® server and clients include various and connection attributes that are proprietary extensions to the ODBC API.
Non-standard ODBC functions
Function
Description
SQLFetchPrev
This function is the same as the ODBC function SQLFetch, but for fetching previous record.
SQLSetParamValue
This function sets the value of a parameter marker in the SQL statement specified in SQLPrepare. Parameter markers are numbered sequentially from left-to-right, starting with one, and may be set in any order.
SQLGetCol
This function is the same as the ODBC function SQLGetData.
SQLGetAnyData
This function is the same as the ODBC function SQLGetData.
Non-standard ODBC attributes
The following connection attributes are specific to the solidDB® server and clients.
Note If the attribute is marked as OUT, it is a read-only attribute and cannot be set through the ODBC interface.
SQL_ATTR_TF_LEVEL
OUT: integer (TF level: 0=NONE, 1=CONNECTION, 3=SESSION)
The failure transparency level.
SQL_ATTR_TF_RECONNECT_TIMEOUT
IN/OUT: integer
The time in milliseconds the driver should wait until it tries to reconnect to the primary in case of switchover or failover.
SQL_ATTR_TF_WAIT_TIMEOUT
IN/OUT: integer
The time in milliseconds the driver should wait for the server to switch state.
SQL_ATTR_TC_PRIMARY
OUT: string, Primary server connection string
There is always a value indicating the current Primary server.
SQL_ATTR_TC_SECONDARY
OUT: string, Secondary server connection string
The value indicates the assigned workload server if:
– PA=READ_MOSTLY, and
– the Secondary is the designated workload server. Otherwise, the returned string is empty.
SQL_ATTR_TF_WAITING
OUT: string, Secondary server connection string.
The value indicates the assigned watchdog (waiting) connection. Waiting connection is used by ODBC driver internally to detect possible looses (crashes, unavailability) of the primary server faster. The string is empty if the connection is not a TC connection.
SQL_ATTR_PA_LEVEL
OUT: integer (Preferred Access level: 0=WRITE_MOSTLY, 1=READ_MOSTLY)
The attribute indicates whether the load balancing is used or not.
SQL_ATTR_TC_WORKLOAD_CONNECTION
OUT: string, server name of the workload connection
The current workload connection server; if queried before the Commit, the value indicates the server the transaction will be committed on. It may be queried as the statement attribute as well. In that case, it indicates the server the next statement will be executed on.
SQL_ATTR_LOGIN_TIMEOUT_MS
IN/OUT: integer, login timeout in milliseconds
There is also a standard attribute SQL_ATTR_LOGIN_TIMEOUT that can be used to set the timeout in seconds.
SQL_ATTR_CONNECTION_TIMEOUT_MS
IN/OUT: integer, connection timeout in milliseconds
There is also a standard attribute SQL_ATTR_CONNECTION_TIMEOUT that can be used to set the timeout in seconds.
SQL_ATTR_QUERY_TIMEOUT_MS
IN/OUT: integer, query timeout in milliseconds
There is also a standard attribute SQL_ATTR_QUERY_TIMEOUT that can be used to set the timeout in seconds.
SQL_ATTR_IDLE_TIMEOUT
IN/OUT: integer, connection idle timeout in minutes
Indicates the connection specific idle timeout to be used by the server. If there is no activity on the connection for specified time period, the server automatically shuts down the connection, effectively throwing out the user.
Special semantics:
– -1 (default) - the connection timeout is equal to the server default
– 0 - no idle timeout, connection is never closed
This property value can be set only before executing SQLConnect().
SQL_ATTR_HANDLE_VALIDATION (environment handle attribute)
IN/OUT: integer, turns ODBC standard handle validation on (1) or off (0).
Default is 0.
This attribute is global; when set, it affects all the solidDB® ODBC connections initiated by the application. This ensures consistency by preventing the application from allocating both validated and non-validated handles.
In certain systems, for example in Windows with ODBC driver manager involved, the driver manager performs the handle validation and the solidDB® ODBC driver does not have to repeat the same validation procedures by itself. Also, a carefully written ODBC application normally does not cause invalid handles to be used; in that case, the handle validation in the ODBC driver is not needed. In both cases, the applications may benefit from performance improvements when skipping the handle validation in the driver. In the case the handle validation is turned off, and invalid handle is used by the application, the ODBC driver behavior is unpredictable and, most likely, it causes the application to crash.
SQL_ATTR_SET_CONNECTION_DEAD
IN/OUT: integer, should be set to 1 when needed
When this attribute is set on a connection, it causes the driver to abort the connection forcibly, without a disconnecting handshake with the server. After the attribute is set to 1, the connection becomes unusable.
USE_ENCRYPTION
See also
solidDB® ODBC API