skip to main content
OpenAccess SDK SQL Engine core methods for Java : Exchanging data : dam_getInfo
 

dam_getInfo

This method returns the requested connection and statement level information from the OpenAccess SDK SQL engine. See Table 186 for the types of information that can be returned.
int dam_getInfo(
    long         hdbc,
    long         hstmt,
    int          iInfoType,
    StringBuffer pStrInfoValue,
    xo_int       pIntInfoValue)
Table 185. Parameters for dam_getInfo
Parameter
Type
Description
INPUT
hdbc
long
The OpenAccess SDK SQL engine connection handle to be used for connection level options. Set to 0 for statement level options.
hstmt
long
The statement handle to be used for statement level options. Set to 0 for connection level options.
iInfoType
int
The type of information requested. See Table 186 for a list of options.
OUTPUT
pStrInfoValue
StringBuffer
String information type is returned in this object.
pIntInfoValue
xo_int
Integer and short integer information types are returned in this object.
RETURN
int
Status of the call:
DAM_SUCCESS - retrieved the iInfoType value.
DAM_FAILURE - wrong value for iInfoType or the output buffer is not large enough.
Table 186. dam_getInfo Infotype Options
Information Type
Description
DAM_INFO_BLOCKJOIN_IS_ ENABLED
Statement level information. The return value is a short integer with Value 1 if Block Join is enabled for the query. The value is 0 if Block Join is disabled.
DAM_INFO_CLIENT_ADDRESS
Connection level information. Returns the local IP address of the client as a string of the form 'ddd.ddd.ddd.ddd' (for example "100.23.24.25". The value is a string of maximum 128 characters. This option can be used while running in DAM_MODE to implement a client IP-based authentication scheme.
DAM_INFO_CLIENT_APPLICATION_NAME
Connection level information indicating the name of the client application on this connection. The value is an ASCII string of maximum length 128.
DAM_INFO_CLIENT_PRODUCT_VERSION
Connection level information indicating the version of the client product that the OpenAccess SDK client is accessing for this connection. The value is a string of maximum 128 characters.
DAM_INFO_CLIENT_PUBLIC_ADDRESS
Connection level information. Returns the public IP address of the client as a string of the form 'ddd.ddd.ddd.ddd' (for example "100.23.24.25". The value is a string of maximum 128 characters. This option can be used while running in DAM_MODE to implement a client IP-based authentication scheme.
DAM_INFO_CLIENT_TYPE
Connection level information indicating the OpenAccess SDK client type for this connection. The value is a short integer. The possible values are:
*DAM_CLIENTTYPE_ODBC
*DAM_CLIENTTYPE_JDBC
*DAM_CLIENTTYPE_OLEDB
*DAM_CLIENTTYPE_NET
DAM_INFO_CONNECTION_ALIVE
Connection level information. This value is returned as a short integer. A value of 0 is returned if connection is not active. The IP can cancel its operations and return DAM_FAILURE. The SQL Engine then closes the connection.
The ServiceSQLCheckConnectionAlive service attribute must be enabled to support this feature. The default is Enable. Refer to the OpenAccess SDK Administrator's Guide for more information about the ServiceSQLCheckConnectionAlive attribute.
DAM_INFO_CONNECTION_MODEL
Global information. Returns a short integer value indicating the threading mode of the service that is associated with this data source. The threading modes are:
*DAM_CONNECTMODEL_THREADPOOL
*DAM_CONNECTMODEL_PROCESS
*DAM_CONNECTMODEL_THREAD
DAM_INFO_DAM_HDBC
Statement level information. Returns the connection handle for the given statement. The value is returned as void *. This must be casted to DAM_CONN_DA pointer.
DAM_INFO_DISTINCT_OPTIMIZABLE
Statement level information. The return value is greater than 0 if the current query has a SELECT DISTINCT clause that can be processed by the IP. The value is returned as a short integer. If the IP decides to handle the DISTINCT processing then it should call the dam_setOption to set the DAM_STMT_OPTION_DISTINCT to DAM_PROCESS_OFF.
DAM_INFO_ESTIMATED_NUM_SUBQUERIES
Statement level information. Returns the expected number of subqueries to process the given query. The value returned is an int data type.
DAM_INFO_FETCH_BLOCK_SIZE
Connection level information for the number of rows to be fetched each time EXECUTE is called. This information is used if the IP is implementing cursor based select processing. The value is returned as a short integer.
DAM_INFO_GROUP_BY_OPTIMIZABLE
Statement level option. The returned value is greater than 0 if the current query has a GROUP BY clause that can be processed by the IP. This value is a short integer and it indicates the number of columns in the GROUP BY clause. Use dam_getGroupByCol to get information about the columns in the GROUP BY statement.
DAM_INFO_IP_CLASS
Connection level information. Returns the DataSourceIPClass attribute value. The value is an ASCII string of maximum length 128.
DAM_INFO_IP_SUPPORT_UNICODE_INFO
Connection level information. Returns a value that indicates that the IP supports Unicode options in ipGetInfo and ipSetInfo. The value returned is of a short data type.
DAM_INFO_JOIN_QUERY_SIZE
Statement level option. Returns the size (in the number of tables) of the join query being processed. This value is returned as a short integer. A value of 1 is returned if the query is a simple single table select.
An IP can call this method from EXECUTE to check if the current query being processed is part of a join and call dam_getInfo (DAM_INO_QUERY_PROCESS_ORDER) to get the process order of the current table.
DAM_INFO_LANGUAGE_ID
Connection level information. Returns the LANGUAGE ID. The value returned is an ASCII string having a maximum length of 128 characters.
DAM_INFO_LOGFILE
Connection level information. Returns the LOG file name. The value returned is an ASCII string having a maximum length of 128 characters.
DAM_INFO_MODE
Global information (set hdbc and hstmt to 0). Returns a short integer with the value DAM_MODE_SERVER or DAM_MODE_LOCAL to indicate if the IP module has been loaded by an OpenAccess SDK Server or an OpenAccess SDK Local Server. Use this information to control the behavior of your IP for standalone operation and for client/server operation without having to have separate builds.
DAM_INFO_OASQL_INI
Global information (set hdbc and hstmt to 0). Returns the path and the file name that is being used for the OpenAccess SDK configuration information. The information is returned as a character string.
DAM_INFO_ORDER_BY_OPTIMIZABLE
Statement level option. The returned value is greater than 0 if the current query has an ORDER BY clause that can be processed by the IP. This value is a short integer and it indicates the number of columns in the ORDER BY clause. Use dam_getOrderByCol( ) to get information about the columns in the ORDER BY statement.
DAM_INFO_ORIGINAL_QUERY_STRINGW
Statement level information. Retrieves the SQL string as specified by the application. The information is returned as a wide character string. Can be used to implement your own logging of queries.
DAM_INFO_OUTER_TABLE_ CUR_ROWCOUNT
Statement level information. Returns the outer table current rowcount. If query is not a join, 0 is returned.
When the IP is processing inner query, it can get row count of outer table. The IP can use this information to decide if inner table can be processed as TableRowset. If outer table row count is a small number like 1, the IP can process the inner query directly and not use TableRowset.
The return value is a 64-bit integer.
DAM_INFO_PASSTHROUGH_QUERY
Statement level information. The return value is greater than 0 if the current query is being executed in pass-through mode. The value is a short integer.
DAM_INFO_QUERY_CANCEL
Statement level information. The return value is greater than 0 if the current query execution was requested to be cancelled. The value is a short integer. When the IP detects a CANCEL request, it must clean up its resources that were allocated to handle this statement and return a DAM_FAILURE.
DAM_INFO_QUERY_MAX_ROWS
Statement level information. Returns the least of MaxRows or TOP N value provided in the query. The value returned is an int64 data type.
DAM_INFO_QUERY_HAS_NOWAIT
Statement level information. Indicates whether the NOWAIT clause was specified in the SELECT FOR UPDATE statement. Used to determine whether or not to wait when a row needs to be locked but it is already locked. The return value is a short integer 1 if there is a NOWAIT clause and 0 otherwise.
DAM_INFO_QUERY_HAS_SEARCH_ CONDITION
Statement level information. Indicates whether or not a statement has a WHERE clause. This can be used to detect operations that are on the entire table. The return value is a short integer 1 if there is a where clause and 0 if there is no WHERE clause.
DAM_INFO_QUERY_IS_NESTED
Statement level option. This method will return a short integer, 1 if the current statement represents a inner query and 0 if it represents an outer query. Note that if the outer query is a join the queries on the tables in the join list are considered to be outer queries. For example, the table DEPT is considered an inner query in the following query:
SELECT * FROM emp WHERE dept_id in (SELECT dept_id FROM dept WHERE location='SJ')
DAM_INFO_QUERY_PROCESS_ORDER
Statement level option. When executing a JOIN on M tables, the returned value indicates which of the M tables is being processed. A value of 0 is returned for the first table and a value of M-1 for the last table. This value is returned as a short integer.
DAM_INFO_QUERY_TIMEOUT
Statement level option. Returns the query timeout value in seconds. This value is returned as an integer. A value of 0 is returned if query does not have a timeout set.
DAM_INFO_QUERY_TOP_ROWS
Statement level information. For a query containing a TOP N clause, the return value is N if the TOP N can be pushed down to the IP. The value is 0 (DAM_MAX_ROWS_UNLIMITED) if query does not have TOP N option or option cannot be exposed to the IP. The value is a 64-bit integer.
DAM_INFO_QUERY_TYPE
Statement level information. Returns the type of query that is being processed. The query type value is returned as a short integer that is one of the constants defined for the statement type in the EXECUTE method.
DAM_INFO_RM_GUID
Connection level information. Retrieves the resource manager ID of the current MTS transaction. The information is returned as a character string of 36 characters. This information is not available during a ipStartTransaction IP call.
DAM_INFO_SCHEMA_PATH
Connection level information. Retrieves the schema path for the connection. The information is returned as a character string.
DAM_INFO_SECURITY_HANDLE
Connection level information. Returns the security data for the given connection.
DAM_INFO_SERVICEIPPATH
Connect level information. Returns the path for the IP files as set in the ServiceIPPath attribute. The value is an ASCII string of maximum length 256.
DAM_INFO_SESSION_CIPHER_SUITE
Connection level information. Returns the cipher suite used for communication between the OpenAccess SDK client and server. The value returned is a string data type.
DAM_INFO_SESSION_CRYPTO_PROTOCOL_VERSION
Connection level information. Returns the cryptographic protocol version that can be used to create an SSL connection between the OpenAccess SDK client and server. The value returned is an integer data type.
Valid or expected values are the following SSL/TLS versions:
*DAM_VERSION_UNDEFINED – 0
*DAM_VERSION_TLS1 – 1
*DAM_VERSION_TLS1_1 – 2
*DAM_VERSION_TLS1_2 – 3
*Default when SSL Enabled:
DAM_VERSION_TLS1_2 – 2
DAM_INFO_SESSION_TOKEN
Connect level information. Returns session token as defined by the DataSourceSessionToken attribute. The value is an ASCII string of maximum length 1024.
For example:
Session from $ClientInfo connected to $DataSourceName
DAM_INFO_SET_FUNCTIONS_IN_QUERY
Statement level information. Returns the number of set functions in the given query. The value returned is an int data type.
DAM_INFO_SETLOCALE
Connection level information. Returns the LOCALE information of the client. The value returned is an ASCII string having a maximum length of 128 characters.
DAM_INFO_STMT_IP_CONTEXT
Statement level information. Retrieves the context information stored for the entire query. The returned value is a void * (pass in an address of a void * variable for pInfoValue and a size of void * for integer).
DAM_INFO_TXN_ID
Connection level information. Retrieves the transaction ID of the current MTS transaction. The information is returned as a character string of 36 characters. This information is not available during startTransaction IP call.
DAM_INFO_TXN_INFO
Connection level information. Retrieves the transaction information that is associated with the current MTS transaction. The information is returned as a character string of up to 240 characters. This information is not available during a startTransaction IP call.
DAM_INFO_TXN_ISO_LEVEL
Connection level information. Returns the isolation level of the connection. The value returned is an int data type.
DAM_INFO_TXN_NESTING_LEVEL
Connection level information. Returns the nesting level of the transaction. The value returned is of a short data type.
DAM_INFO_TXN_TYPE
Connection level information. Provides information about the current mode of transaction processing. The options are:
*DAM_TXN_IMPLICIT - the currently active transaction is a local transaction with AUTO COMMIT ON option set on the connection. In this mode the ODBC driver or ADO data provider generates a COMMIT after each non- SELECT statement. This will result in the EndTransaction() being called with the specified option. This will then be followed by an ip_xxx_StartTransaction() call to start a new transaction.
*DAM_TXN_EXPLICIT - the currently active transaction is a local transaction with AUTO COMMIT OFF. In this mode the application must call COMMIT or ROLLBACK. This will result in the ip_xxx_EndTransaction() being called with the specified option, which will be followed by an ip_xxx_StartTransaction() to start a new transaction.
DAM_INFO_USER
Connection level information. Returns the user name of the connection. The value returned is an ASCII string having a maximum length of 128 characters.

See also

*dam_getGroupByCol
*dam_getOrderByCol