In this post, originally written by Glenn Paulley and posted to sybase.com in March of 2009, Glenn talks about the differences between JConnect and the SQL Anywhere JDBC driver. While I have left in the references to specific supported versions of JConnect, JDBC and SQL Anywhere for historical reference, I do want to note that versions 12 and 16 of the SQL Anywhere JDBC driver now support JDBC 4.0. The latest version of JConnect is 7.07 and also supports JDBC 4.0.
Lately I've been getting some questions about the differences between Sybase jConnect and the iAnywhere JDBC driver, so I thought I'd put some points down here. Eventually I'll turn this content into a Sybase technical document, but here it is for now.
A brief summary of the differences between the two JDBC implementations are as follows:
Sybase jConnect is a Type 4 JDBC driver which is entirely Java-based. In contrast, the iAnywhere JDBC driver is a Type 1 driver, as it relies on its underlying (non-Java) ODBC driver to actually communicate with the SQL Anywhere server. Both the iAnywhere JDBC driver and jConnect 6.0.5 are JDBC 4.0 compliant.
SQL Anywhere Version 11 supports only JDBC 3.0 (JDK 1.4 and up). SQL Anywhere Version 10 supported both JDBC 2.0 and 3.0; the jodbc.jar that shipped with Version 10 contained support for both, but which version was used depended on the driver name:
If you plan to utilize a Java application on a Windows CE platform, the older jConnect 5.5 may be your best option. On Windows CE, the best Java VM to install is IBM's J9 VMwith the "Mobile Database Option", which provides JDBC 2.0 support (from JDK Version 1.3). However, as only jConnect 5.5 is JDBC 2.0-compliant---jConnect 6.05 and SQL Anywhere 11 require JDBC 3.0---then you should install jConnect 5.5 (jconn2.jar) on the device.
Using jConnect with SQL Anywhere on any platform requires installation of jConnect's JDBC metadata schema in the database. By default, SQL Anywhere databases are created with jConnect metadata support; you can explicitly add it using dbupgrad -j
. jConnectis downloadable from sybase.com. Make sure you specify "all months" for the display of possible versions/EBFs to download:
When connecting via JConnect, the SQL Anywhere server automatically resets the values of several option settings to permit the server to emulate Sybase ASE behaviour; this occurs in the sp_tsql_environment system procedure, which executes the following SET OPTION
statements for the connection:
SET TEMPORARY OPTION allow_nulls_by_default='Off';
SET TEMPORARY OPTION ansi_blanks='On';
SET TEMPORARY OPTION ansinull='Off';
SET TEMPORARY OPTION chained='Off';
SET TEMPORARY OPTION close_on_endtrans='Off';
SET TEMPORARY OPTION date_format='YYYY-MM-DD';
SET TEMPORARY OPTION date_order='MDY';
SET TEMPORARY OPTION escape_character='Off';
SET TEMPORARY OPTION isolation_level='1';
SET TEMPORARY OPTION on_tsql_error='Continue';
SET TEMPORARY OPTION quoted_identifier='Off';
SET TEMPORARY OPTION time_format='HH:NN:SS.SSS';
SET TEMPORARY OPTION timestamp_format='YYYY-MM-DD HH:NN:SS.SSS';
SET TEMPORARY OPTION tsql_variables='On';
Note that the original or default values for the connection are not retained. Also note that the default isolation level for TDS connections is "1" (READ COMMITTED). Older versions of both DBISQL and Sybase Central undo these temporary option settings after they have connected to the database server to retain SQL Anywhere semantics as much as possible, so one may not notice any difference. Newer versions of the DBISQL and Sybase Central admin tools (SQL Anywhere Version 10 and up) no longer support connecting via jConnect.
Next: Semantic and performance differences between jConnect and the iAnywhere JDBC driver.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
4 |