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 |
---|---|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Not supported |
|
Not supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Not supported |
|
Not supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Not supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Not supported |
|
Not supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
|
Supported |
The parameter based calls are not supported because support for them is not provided in JDBC 2.
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.