Sybase Jconnect 6 Jdbc Drivers

admin

JConnect for JDBC. JConnect provides high performance native access to the complete family of SAP products including Adaptive Server Enterprise, SQL Anywhere Server Anywhere, Adaptive Server IQ, and Replication Server. Required File(s) jconn4.jar Default Driver Class com.sybase.jdbc4.jdbc.SybDriver JDBC URL Format. The classes in jConnect are all in the com.sybase package. The client application needs to access classes in com.sybase.jdbc. For your application to use jConnect, you must import these classes at the beginning of each source file: import com.sybase.jdbc. Installing jConnect system objects into a database. Using the Sybase jConnect driver. The jConnect driver is a pure-java, type-4 JDBC driver distributed by Sybase. The driver is bundled with the WebLogic Server distribution and may be freely used. This document describes how to use the jConnect driver in a connection pool running in WebLogic Server. Things to know about the jConnect driver. The jConnect driver is a Type 4, or Direct to Database Pure Java, JDBC driver. This means that the driver takes JDBC calls and directly converts it to the vendor specific protocol, in this case TDS. Written completely in Java, a type 4 driver is platform independent.

  1. Sybase Jconnect 6 Jdbc Drivers List
  2. Sybase Jconnect 6 Jdbc Drivers Free
  3. Sybase Ase Jconnect Driver Download

I'm trying to establish an SSL connection to a Sybase ASE 15.7 using JDBC driver with no luck. I tried the following options: Using JTDS 1.25 driver (jtds-1.2.5.jar) With the following connection. Sybase JConnect JDBC driver. System Center Orchestrator. Sybase JConnect 6 JDBC drivers on each runbook server and Runbook Designer using the integration pack. Mar 16, 2017  I am searching for the latest jConnect JDBC driver, preferably one that is JDBC 4.1 or 4.2 compliant. The newest jConnect driver I can find is: $ java -jar jconn4.jar jConnect (TM) for JDBC(TM)/16.0 GA (Build 27008)/P/EBF22326/JDK 1.6.0/jdbcmain/OPT/.

Active3 years, 11 months ago

I'm trying to establish an SSL connection to a Sybase ASE 15.7 using JDBC driver with no luck.I tried the following options:

  1. Using JTDS 1.25 driver (jtds-1.2.5.jar)

    With the following connection string: jdbc:jtds:sybase://host:port;databaseName=dbname;ssl=request

    I got Network error IOException: Connection refused

  2. Using Jconnect 4 (jconn4.jar)

    with the following connection string:

    jdbc:sybase:Tds:host:port/dbname?ENABLE_SSL=true

    I got java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s)..java.sql.SQLException: I/O Error: DB server closed connection.

    I checked the Sybase log see the following error:

    kernel SSL or Crypto Error Message: 'The SSL handshake failed. Root error: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol'.

    it looks like the Sybase server expects SSL connection but the java client still not using SSL (although connection string property marks ssl=true).

tried searching Sybase documentation with not much luck, neither for this error nor for SSL with JConnect.

Any answer will be much appreciated - i'm flexible with the type of driver and the configuration.

Thanks

zuckermanorizuckermanori
9531 gold badge12 silver badges26 bronze badges

1 Answer

After much investigation, I found a solution. 2 actually.

  1. Using trust all certificate JDBC connection string parameter:if you don't mind to trust all certificates (do this only if you entirely trust the network you're working in, especially not anything going on the public internet), you may add a connection string indicating the SSLSocketFactory creating the connection to trust all certificates. The connection string will look as follows: jdbc:sybase:Tds:host:port/dbname?ENABLE_SSL=true&SSL_TRUST_ALL_CERTS=true
  2. Using the sybase certificate:the certificate needs to be imported to the java application trust store.in case you're not working with a designated trust store, it may be imported to the Java default trust store found under $JAVA_HOMEjreXlibsecuritycacerts. The certificate may be imported using keytool as explained here.
zuckermanorizuckermanori
9531 gold badge12 silver badges26 bronze badges

Not the answer you're looking for? Browse other questions tagged javassljdbcsybasejconnect or ask your own question.

This section discusses the following topics:

Overview of XA Drivers

This section provides an overview of XA JDBC drivers with WebLogic Server in distributed transactions. These drivers provide connectivity between WebLogic Server connection pools and the DBMS. Drivers used in distributed transactions are designated by the driver name followed by /XA; for example, Oracle Thin/XA Driver.

Table of XA Drivers

The following table summarizes known functionality of these JDBC/XA drivers when used with WebLogic Server:

Table 10-1 Two-Tier JDBC/XA Drivers

Driver/Database VersionComments

Oracle Thin Driver XA

See Using Oracle Thin/XA Driver.

Sybase jConnect/XA

  • Version 6.0

  • Version 5.5

  • Adaptive Server Enterprise 12.0

See Using Sybase jConnect 5.5 and 6.0/XA Drivers.


Sybase Jconnect 6 Jdbc Drivers List

Using Oracle Thin/XA Driver

WebLogic Server ships with the Oracle Thin Driver version 10g preconfigured and ready to use. If you want to update the driver or use a different version, see 'Using Oracle Extensions with the Oracle Thin Driver' in Programming JDBC for Oracle WebLogic Server.

The following sections provide information for using the Oracle Thin/XA Driver with WebLogic Server.

Software Requirements for the Oracle Thin/XA Driver

The Oracle Thin/XA Driver requires the following:

  • Java 2 SDK 1.4.x or later.

    Note:

    The Oracle 10g and 9.2 Thin driver (ojdbc14.jar) are the only versions of the driver supported for use with a Java 2 SDK 1.4.X.
  • Oracle server configured for XA transaction support.

Set the Environment for the Oracle Thin/XA Driver

The following sections explain how to set the environment for the Oracle Thin/XA Driver.

Configure WebLogic Server

See 'Using Oracle Extensions with the Oracle Thin Driver' in Programming JDBC for Oracle WebLogic Server.

Enable XA on the Database Server

To prepare the database for XA, perform these steps:

  1. Log on to sqlplus as system user, for example, sqlplus sys/CHANGE_ON_INSTALL@<DATABASE ALIAS NAME>

  2. Execute the following command: @xaview.sql

    The xaview.sql script resides in the $ORACLE_HOME/rdbms/admin directory

  3. Grant the following permissions:

    • grant select on v$xatrans$ to public (or <user>);

    • grant select on pending_trans$ to public;

    • grant select on dba_2pc_pending to public;

    • grant select on dba_pending_transactions to public;

    • when using the Oracle Thin driver 10.1.0.3 or later:

      grant execute on dbms_system to <user>;

If the above steps are not performed on the database server, normal XA database queries and updates may work fine. However, when the Weblogic Server Transaction Manager performs recovery on a re-boot after a crash, recover for the Oracle resource faisl with XAER_RMERR. Crash recovery is a standard operation for an XA resource.

Oracle Thin/XA Driver Configuration Properties

The following table contains sample code for configuring a JDBC data source:

Table 10-2 Oracle Thin/XA Driver: Connection Pool Configuration

Property NameProperty Value

Name

URL

DriverClassname

Database Username

Properties

Test Table Name

DUAL


Using Sybase jConnect 5.5 and 6.0/XA Drivers

The following sections provide important configuration information and performance issues when using the Sybase jConnect Driver 5.5 and 6.0/XA Drivers:

Configuring a Sybase Server for XA Support

Follow these instructions to set up the environment on your database server:

  • Run sp_configure 'enable DTM',1 to enable transactions.

  • Run sp_configure 'enable xact coordination',1.

  • Run grant role dtm_tm_role to <USER_NAME>.

  • Copy the sample xa_config file from the SYBASE_INSTALLOCS-12_0samplexa-dtm subdirectory up three levels to SYBASE_INSTALL,where SYBASE_INSTALL is the directory of your Sybase server installation. For example:

  • Edit the xa_config file. In the first [xa] section, modify the sample server name to reflect the correct server name.

To prevent deadlocks when running transactions, enable row level lock by default:

  • Run sp_configure 'lock scheme',0,datarows

    Note:

    The jConnect.jar, jconn2, and jconn3.jar files are no longer included with WebLogic Server. You can, however, download the Sybase drivers directly from Sybase.

XA and Sybase Adaptive Server

Correct support for XA connections is available in the Sybase Adaptive Server Enterprise 12.0 and later versions only. XA connections with WebLogic Server are not supported on Sybase Adaptive Server 11.5 and 11.9.

Execution Threads and Transactions in Sybase Adaptive Server

Prior to Adaptive Server version 12.0, all resources of a transaction were privately owned by a single task on the server. The server could not share a transaction with any task other than the one that initiated the transaction. Adaptive Server version 12.x includes support for the suspend and join semantics used by XA-compliant transaction managers (such as WebLogic Server). Transactions can be shared among different execution threads, or may not be associated with an execution thread (detached).

Setting the Timeout for Detached Transactions

On the Sybase server, you can set the dtm detach timeout period, which sets the amount of time (in minutes) that a distributed transaction branch can remain in the detached state (without an associated execution thread). After this period, the DBMS automatically rolls back the transaction. The dtm detach timeout period applies to all transactions on the database server. It cannot be set for each transaction.

For example, to automatically rollback transactions after being detached for 10 minutes, use the following command:

You should set the dtm detach timeout period higher than the transaction timeout to prevent the database server from rolling back the transaction before the transaction times out in WebLogic Server.

For more information about the dtm detach timeout period, see the Sybase documentation.

Transaction Behavior on Sybase Adaptive Server

If a global transaction is started on the Sybase server, but is not completed, the outcome of the transaction varies depending on the transaction state before the transaction is abandoned:

Sybase Jconnect 6 Jdbc Drivers Free

  • If the client is terminated before the xa.end call, the transaction is rolled back.

  • If the client is terminated after the xa.end call, the transaction remains on the database server (and holds all relevant locks).

  • If an application calls xa.start but has not called xa.end and the application terminates unexpectedly, the database server immediately rolls back the transaction and frees locks held by the transaction.

  • If an application calls xa.start and xa.end and the application terminates unexpectedly, the database server rolls back the transaction and frees locks held by the transaction after thedtm detach timeout periodhas elapsed. See Setting the Timeout for Detached Transactions.

  • If an application calls xa.start and xa.end, and then the transaction is prepared, if the application terminates unexpectedly, the transaction persists so that it can be properly recovered. The Transaction Manager must call rollback or commit to complete the transaction.

Configuration Properties for Java Clients

Set the following configuration properties when running a Java client.

They are calibrated for a broader audience. Headphones

Jdbc

Table 10-3 Sybase jConnect 5.5/XA Driver: Java Client Connection Properties

Property NameProperty Value

port (Typically 4100)


Sybase Ase Jconnect Driver Download

Known Sybase jConnect 5.5 and 6.0/XA Issues

These are the known issues and Oracle workarounds:

Sybase

Table 10-4 Sybase jConnect 5.5 and 6.0 Known Issues and Workarounds

DescriptionSybase BugComments/Workarounds for WebLogic Server

When calling setAutoCommit(true) the following exception is thrown:

10726192

No workaround. Vendor fixed in jConnect 6.0.

When driver used in distributed transactions, calling XAResource.end(TMSUSPEND) followed by XAResource.end(TMSUCCESS) results in XAER_RMERR.

10727617

WebLogic Server has provided an internal workaround for this bug:

Set the data source connection pool property XAEndOnlyOnce='true'.

Vendor fix has been requested.


Using Other XA Drivers

To use other XA-compliant JDBC drivers, you must include the path to the driver class libraries in your CLASSPATH and follow the configuration instructions provided by the vendor.