cancel
Showing results for 
Search instead for 
Did you mean: 

Querying a remote Sybase instance via a Type 3 jdbc driver

Former Member
0 Kudos
2,460

Hi,

We have a remote Sybase db that provides only an odbc driver. Our Java application runs on a separate machine. I assume I need a Type 3 JDBC driver where the proxy on the db machine needs a jdbc/odbc bridge to Sybase. Is this feature supported by SQL Anywhere? If not, I'd really appreciate if someone could point me in the right direction.

Thanks a ton.

VolkerBarth
Contributor
0 Kudos

Are you using SQL Anywhere (in contrast to Sybase ASE?)

The following doc for JDBC support in SQL Anywhere may be of help. Note, it's for version 12, older versions have somewhat different support.

VolkerBarth
Contributor
0 Kudos

Here's a further reference from Jason's blog on the various JDBC driver versions in SQL Anywhere 9.0.2 and above.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

If you are using ASE, then you can use the jConnect JDBC driver that is available with ASE. Note that jConnect is a Type-4 driver so there is no need for ODBC or any other native component. If you are using SQL Anywhere, then you can use the SQL Anywhere JDBC driver that came with your copy of SQL Anywhere. In SQL Anywhere 12, the SA JDBC driver is a Type-2 driver and does not require any ODBC component. In SQL Anywhere 11 and below, the SA JDBC driver (known as the iAnywhere JDBC driver in these older versions) is a Type-1 driver and will happily work with the SQL Anywhere ODBC driver that came with your version of SQL Anywhere. There is no officially supported Type-3 JDBC driver for either SQL Anywhere or ASE.

One final note, the jConnect driver that I mentioned above for ASE also works with SQL Anywhere. If you are using SQL Anywhere, and if your particular environment demands a pure JAVA driver (which jConnect is since it is a Type-4 driver), then you can go ahead and use jConnect with SQL Anywhere. I should point out though, that in general we recommend that you use the SQL Anywhere JDBC driver with SA since it tends to be better geared towards SA and generally performs better than jConnect WHEN talking to SA. But, if you are using ASE, then you have NO choice but to use jConnect with ASE. Note that jConnect is geared towards ASE and performs quite well when talking to ASE.

HTH Karim

Former Member

I was asked this morning what exactly is a Type-3 driver. Allow me to elaborate.

A Type-1 driver has a JAVA layer that talks JDBC to the application and then loads a non-JAVA ODBC driver which talks ODBC to the data source. The iAnywhere JDBC driver in SA 11 and below is a Type-1 driver since it has a JAVA layer that provides the JDBC interface and then subsequently loads the SA JDBC driver to talk to SQL Anywhere.

A Type-2 driver has a JAVA layer that talks JDBC to the application and a non-JAVA layer that talks to the data source using a native protocol. The SQL Anywhere JDBC driver in SA 12 is a Type-2 driver since it has a JAVA layer that provides the JDBC interface and a non-JAVA layer that talks directly to SQL Anywhere without using ODBC.

A Type-3 driver is a pure JAVA JDBC driver that uses a non-native protocol to talk to the data source. For example, a user who wanted to use jConnect to talk to SQL Anywhere 5.5 would first have to run something called the Open Server Gateway. The user would then use jConnect which is a pure JAVA JDBC driver to talk directly to the Open Server Gateway using the TDS protocol, and the Open Server Gateway would subsequently talk to SQL Anywhere 5.5. So in SA 5.5, jConnect is considered a Type-3 driver since it is a pure JAVA JDBC driver that does not use a native protocol to talk to SQL Anywhere 5.5.

A Type-3 JDBC driver can also be a pure JAVA JDBC driver that provides the JDBC interface to the application, but then subsequently loads a secondary, third party supplied, pure JAVA piece that talks to the target data source.

A Type-4 driver is a pure JAVA JDBC driver that talks to the data source using a native protocol. Unlike SQL Anywhere 5.5, SQL Anywhere 6.0.0 and up allows jConnect to connect directly without requiring the Open Server Gateway as a go-between. As a result, jConnect is a Type-4 JDBC driver for SQL Anywhere 6.0.0 and up.

Karim