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

Last updated on AUGUST 03, 2016

Applies to:

JDBC - Version 10.1.0.2 and later
Information in this document applies to any platform.
***Checked for relevance on 14-May-2013***



Goal

An application is using Oracle JDBC driver in order to fetch Long Raw column (CREATE TABLE TST (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 TST");
while (rset.next()) {
total = 0;
is = rset.getBinaryStream(1);
if (is != null) {
while ((rd = is.read(bar)) > 0) {
total += rd;
}
is.close();
}


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



Solution

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms