ca.bc.gov.webade
Class OracleObjectHandler

java.lang.Object
  extended byca.bc.gov.webade.OracleObjectHandler

public final class OracleObjectHandler
extends java.lang.Object

An Oracle database object utiliy class to handle reading and writing of BLOBs, CLOBs, and other helper utils.

Author:
jross

Constructor Summary
OracleObjectHandler()
           
 
Method Summary
static boolean readBlob(oracle.sql.BLOB blob, java.io.OutputStream outputStream)
          Writes the given BLOB data to the given output stream.
static boolean readClob(oracle.sql.CLOB clob, java.io.OutputStream outputStream)
          Writes the given CLOB data to the given output stream.
static void writeBlob(oracle.sql.BLOB blob, java.io.InputStream inputStream)
          Writes the given input stream data to the given BLOB.
static void writeClob(oracle.sql.CLOB clob, java.io.InputStream inputStream)
          Writes the given input stream data to the given CLOB.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleObjectHandler

public OracleObjectHandler()
Method Detail

readClob

public static boolean readClob(oracle.sql.CLOB clob,
                               java.io.OutputStream outputStream)
                        throws java.sql.SQLException,
                               java.io.IOException
Writes the given CLOB data to the given output stream.

Parameters:
clob - The clob object to read the data from.
outputStream - The output stream to write to.
Returns:
true if the clob contained data, otherwise false.
Throws:
java.sql.SQLException - Thrown if an error occurs.
java.io.IOException - Thrown if an error occurs.

writeClob

public static void writeClob(oracle.sql.CLOB clob,
                             java.io.InputStream inputStream)
                      throws java.sql.SQLException,
                             java.io.IOException
Writes the given input stream data to the given CLOB.

Parameters:
clob - The clob object to read the data from.
inputStream - The input stream to read to.
Throws:
java.sql.SQLException - Thrown if an error occurs.
java.io.IOException - Thrown if an error occurs.

readBlob

public static boolean readBlob(oracle.sql.BLOB blob,
                               java.io.OutputStream outputStream)
                        throws java.sql.SQLException,
                               java.io.IOException
Writes the given BLOB data to the given output stream.

Parameters:
blob - The blob object to read the data from.
outputStream - The output stream to write to.
Returns:
true if the clob contained data, otherwise false.
Throws:
java.sql.SQLException - Thrown if an error occurs.
java.io.IOException - Thrown if an error occurs.

writeBlob

public static void writeBlob(oracle.sql.BLOB blob,
                             java.io.InputStream inputStream)
                      throws java.sql.SQLException,
                             java.io.IOException
Writes the given input stream data to the given BLOB.

Parameters:
blob - The blob object to read the data from.
inputStream - The input stream to read to.
Throws:
java.sql.SQLException - Thrown if an error occurs.
java.io.IOException - Thrown if an error occurs.