About the Easysoft ODBC-JDBC Gateway

The Easysoft ODBC-JDBC Gateway allows applications that support ODBC to connect to any data store that supports JDBC. For example, use the Easysoft ODBC-JDBC Gateway to connect SQL Server to Data Lake.

ODBC API support

Use this table to find out what ODBC API functions the Easysoft ODBC-JDBC Gateway supports:

Function Status

SQLAllocConnect

Supported

SQLAllocEnv

Supported

SQLAllocHandle

Supported

SQLAllocStmt

Supported

SQLBindCol

Supported

SQLBindParameter

Supported

SQLBrowseConnect

Not supported

SQLBulkOperations

Not supported

SQLCancel

Supported

SQLCloseCursor

Supported

SQLColAttribute

Supported

SQLColAttributes

Supported

SQLColumnPrivileges

Supported

SQLColumns

Supported

SQLConnect

Supported

SQLCopyDesc

Not supported

SQLDescribeParam

Not supported

SQLDisconnect

Supported

SQLDriverConnect

Supported

SQLDrivers

Supported

SQLEndTran

Supported

SQLError

Supported

SQLExecDirect

Supported

SQLExecute

Supported

SQLExtendedFetch

Supported

SQLFetch

Supported

SQLFetchScroll

Supported

SQLForeignKeys

Supported

SQLFreeConnect

Supported

SQLFreeEnv

Supported

SQLFreeHandle

Supported

SQLFreeStmt

Supported

SQLGetConnectAtt

Supported

SQLGetConnectOption

Supported

SQLGetCursorName

Supported

SQLGetData

Supported

SQLGetDescField

Supported

SQLGetDescRec

Supported

SQLGetDiagField

Supported

SQLGetDiagRec

Supported

SQLGetEnvAttr

Supported

SQLGetFunctions

Supported

SQLGetInfo

Supported

SQLGetStmtAttr

Supported

SQLGetStmtOption

Supported

SQLGetTypeInfo

Supported

SQLMoreResults

Supported

SQLNativeSql

Supported

SQLNumParams

Not supported

SQLNumResultCols

Supported

SQLParamData

Supported

SQLParamOptions

Supported

SQLPrepare

Supported

SQLPrimaryKeys

Supported

SQLProcedureColumns

Supported

SQLProcedures

Supported

SQLPutData

Supported

SQLRowCount

Supported

SQLSetConnectAttr

Supported

SQLSetConnectOption

Supported

SQLSetCursorName

Supported

SQLSetDescField

Supported

SQLSetDescRec

Supported

SQLSetEnvAttr

Supported

SQLSetParam

Supported

SQLSetPos

Not supported

SQLSetScrollOptions

Not supported

SQLSetStmtOption

Supported

SQLSetStmtAttr

Supported

SQLStatistics

Supported

SQLTablePrivileges

Supported

SQLTables

Supported

SQLTransact

Supported

The parameter based calls are not supported because support for them is not provided in JDBC 2.

Unicode ODBC calls

If available, the Easysoft ODBC-JDBC Gateway supports the Unicode version (with suffix "W", for example, SQLColAttributeW) of the ODBC calls it implements.

XA support

The Easysoft ODBC-JDBC Gateway can provide access to XA resources in the context of a distributed transaction.

To access an XA resource, add a Easysoft ODBC-JDBC Gateway data source that connects to the JDBC driver for the resource by using the XA interface.

To be involved in a distributed transaction, the target JDBC driver must implement the XA features of the JDBC 2.0 Optional Package.

In the Easysoft ODBC-JDBC Gateway data source, set the XA_Enlist data source option to 1. Use XAClass to specify the JDBC driver’s XADataSource class. The class that the JDBC driver implements XADataSource with is used to produce XA connections. Use XIDClass to specify the method the JDBC driver provides to create Xids. The Transaction Manager uses Xids to identify each transaction in a distributed transaction. The XA_Connection_String attribute is required if the DB field is present in the xa_open string. The XA_Connection_String attribute value must be the same as that of the DB field.

This example data source sets up an XA connection to the Oracle JDBC driver:

[XA-OJG]
Driver = Easysoft ODBC-JDBC Gateway
DriverClass = oracle.jdbc.OracleDriver
User = system
Password = manager
ClassPath = /usr/local/oracle/jdbc/lib/ojdbc14.jar
URL = jdbc:oracle:oci8:@//my_host:1521/my_servicename
XA_Enlist = 1
XA_Connection_String = my_database
XAClass = oracle.jdbc.xa.client.OracleXADataSource
XIDClass = oracle.jdbc.xa.OracleXid

Note that if the XA attributes are present, the data source can only be used to access the target database as an XA resource under the control of a Transaction Manager. If you need to access the same database with a non-XA connection, configure a separate data source that does not contain the XA attributes.

The xa_open string

The Transaction Manager uses the xa_open string to connect to the Resource Manager.

The format for the Easysoft ODBC-JDBC Gateway xa_open string is:

ODBCJDBC_XA+DSN=data_source+LogFile=log_file+DB=db_name

ODBCJDBC_XA is the Easysoft ODBC-JDBC Gateway Resource Manager name. Use the DSN field to specify the Easysoft ODBC-JDBC Gateway data source that you configured for the resource. To enable logging, include the optional LogFile field. You need to use this field rather than the standard tracing mechanisms to enable logging for an XA connection. The DB field allows the ODBC connection to find the matching XA connection.

This WebSphere MQ example shows the corresponding xa_open string to use for the XA-OJG data source:

XAOpenString=ODBCJDBC_XA+DSN=XA-OJG+LogFile=/tmp/sql.log+DB=my_database

The xa_switch_t structure

The Easysoft ODBC-JDBC Gateway xa_switch_t structure name is ojg_xaosw. This structure contains the entry points for the Easysoft ODBC-JDBC Gateway Resource Manager. Applications requiring XA support should be built to use this structure. The Easysoft ODBC-JDBC Gateway translates calls into the entry points for the corresponding Java javax.sql.XADataSource methods.