My Oracle Support Banner

Oracle Network Compression Does Not Work With JDBC Thin Driver (Doc ID 2694336.1)

Last updated on OCTOBER 18, 2022

Applies to:

JDBC - Version 12.2.0.0.0 and later
Information in this document applies to any platform.

Symptoms

On : 12.2.0.0.0 version, Thin JDBC driver

ACTUAL BEHAVIOR
---------------
Oracle Network Compression does not work with JDBC Thin driver.

At the database side the support for network compression is enabled in the sqlnet.ora file.
The configuration specified by Oracle on the client side with the JDBC driver is also enabled as shown in the program below.
However, the connection is not using compression.

EXPECTED BEHAVIOR
-----------------------
The connection using JDBC should have the network compression enabled.

sqlnet.ora
==

SQLNET.COMPRESSION=on
SQLNET.COMPRESSION_THRESHOLD=1024

Program
==




Tests:

Using thin driver:
===

java -cp .:ojdbc8.12.2.0.1.0.jar TestJdbcCompression thin

Using: thin
Using jdbc:oracle:thin:@<HOSTNAME>:<PORT>/<SERVICE NAME>
Current sid : 774


Using this SID run the next statement on sqlplus:

set linesize 200
col osuser for a40
col NETWORK_SERVICE_BANNER for a120

select sid, network_service_banner, AUTHENTICATION_TYPE
from gV$SESSION_CONNECT_INFO;

      SID NETWORK_SERVICE_BANNER                                                                                                   AUTHENTICATION_TYPE
---------- ------------------------------------------------------------------------------------------------------------------------ --------------------------
...
      774 TCP/IP NT Protocol Adapter for Linux: Version 12.2.0.1.0 - Production                                                    DATABASE
      774 Encryption service for Linux: Version 12.2.0.1.0 - Production                                                            DATABASE
      774 Crypto-checksumming service for Linux: Version 12.2.0.1.0 - Production                                                   DATABASE


When using OCI:
===
java -cp .:ojdbc8.12.2.0.1.0.jar TestJdbcCompression oci
Using: oci
Using jdbc:oracle:oci:@<HOSTNAME>:<PORT>/<SERVICE NAME>
Current sid : 774


on the sqlplus session:

      SID NETWORK_SERVICE_BANNER                                                                                                   AUTHENTICATION_TYPE
---------- ------------------------------------------------------------------------------------------------------------------------ --------------------------
...
      774 TCP/IP NT Protocol Adapter for Linux: Version 12.2.0.1.0 - Production                                                    DATABASE
      774 Oracle Advanced Network Compression Service for Linux: Version 12.2.0.1.0 - Production                                   DATABASE
      774 Crypto-checksumming service for Linux: Version 12.2.0.1.0 - Production                                                   DATABASE


The result shows the "Oracle Advanced Network Compression Service for Linux" line when running with OCI.

When using JDBC OCI,  the "Oracle Advanced Network Compression Service for Linux" banner is used, but not when using the thin driver.

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.