My Oracle Support Banner

Optimizing Trips From Server to JDBC Application Fetching a Long Raw (Doc ID 414219.1)

Last updated on AUGUST 31, 2023

Applies to:

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


An application is using Oracle JDBC driver in order to fetch Long Raw column (CREATE TABLE <TABLE NAME> (data long raw);)

This is done by using the Streaming method with the following
sequence of code :

bar = new byte[32768];
stmt = _conn.createStatement();
rset = stmt.executeQuery("SELECT data FROM <TABLE NAME>");
while (
  total = 0;
  is = rset.getBinaryStream(1);
  if (is != null)
    while ((rd = > 0)
      total += rd;

The goal of this document  is to show one way to optimize the number of trips from the server to the JDBC application (client) when fetching  Long Raw type data


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

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