com.orindasoft.pub
Class LongObjectLoader

java.lang.Object
  |
  +--com.orindasoft.pub.LongObjectLoader

public class LongObjectLoader
extends java.lang.Object

This utility class is used to get LOB objects into and out of the database.

Under normal circumstances OrindaBuild users will have no reason to use this class directly - the generated code will use it.


(c) Copyright 2003 - 2011 Orinda Software Ltd

Version:
6.0
Author:
Orinda Software

Constructor Summary
LongObjectLoader()
          This utility class is used to get LOB objects into and out of the database.
 
Method Summary
static oracle.sql.BFILE loadBFILE(oracle.sql.BFILE newBFILE, java.io.File theFile, int bufferSize)
          Attempts to upload a File to a BFILE This always fails as BFILES are read only.
static oracle.sql.BLOB loadBLOB(oracle.sql.BLOB newBLOB, byte[] theArray)
          Unloads a byte array to a BLOB
static oracle.sql.BLOB loadBLOB(oracle.sql.BLOB newBLOB, java.io.File theFile, int bufferSize)
          Loads a File into a BLOB
static oracle.sql.CLOB loadCLOB(oracle.sql.CLOB newCLOB, byte[] theArray)
          Loads a byte array into a CLOB
static oracle.sql.CLOB loadCLOB(oracle.sql.CLOB newCLOB, char[] theArray)
          Loads a char array into a CLOB
static oracle.sql.CLOB loadCLOB(oracle.sql.CLOB newCLOB, java.io.File theFile, int bufferSize)
          Loads a File into a CLOB
 void setBufferSize(int bufferSize)
          Set buffer size for IO operations
 void setKeepFiles(boolean keepFiles)
          Sets flag used to determine whether we call the 'deleteOnExit' method for files we download.
 java.io.File unloadBfile(java.io.File newFile, oracle.sql.BFILE tempBFILE)
          Unloads a BFILE column into a file
 byte[] unloadBfileIntoByteArray(oracle.sql.BFILE tempBFILE)
          Unloads a BFILE column into a byte array
 java.io.File unloadBinaryStream(java.io.File newFile, java.io.InputStream theInputStream, java.lang.String columnDataType)
          Unloads a Binary Stream into a file
 java.io.File unloadBinaryStream(java.io.File newFile, java.lang.String theInputString, java.lang.String columnDataType)
          Unloads a LONG column into a file
 byte[] unloadBinaryStreamIntoByteArray(java.io.InputStream theInputStream, java.lang.String columnDataType)
          Unloads a Binary Stream into a byte array.
 java.io.File unloadBlob(java.io.File newFile, oracle.sql.BLOB tempBLOB)
          Unloads a BLOB column into a file
 byte[] unloadBlobIntoByteArray(oracle.sql.BLOB tempBLOB)
          Unloads a BLOB column into a byte array
 java.io.File unloadClob(java.io.File newFile, oracle.sql.CLOB tempCLOB)
          Unloads a CLOB column into a file
 byte[] unloadClobIntoByteArray(oracle.sql.CLOB tempCLOB)
          Unloads a CLOB column into a byte array
 char[] unloadClobIntoCharArray(oracle.sql.CLOB tempCLOB)
          Unloads a CLOB column into a char array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongObjectLoader

public LongObjectLoader()
This utility class is used to get LOB objects into and out of the database.
Method Detail

setKeepFiles

public void setKeepFiles(boolean keepFiles)
Sets flag used to determine whether we call the 'deleteOnExit' method for files we download.

setBufferSize

public void setBufferSize(int bufferSize)
Set buffer size for IO operations

unloadBinaryStream

public java.io.File unloadBinaryStream(java.io.File newFile,
                                       java.io.InputStream theInputStream,
                                       java.lang.String columnDataType)
                                throws CSException
Unloads a Binary Stream into a file
Parameters:
File - newFile File to unload stream into
InputStream - theInputStream Input stream from database
String - columnDataType Column database type

unloadBinaryStreamIntoByteArray

public byte[] unloadBinaryStreamIntoByteArray(java.io.InputStream theInputStream,
                                              java.lang.String columnDataType)
                                       throws CSException
Unloads a Binary Stream into a byte array. This probably won't work for very big LOBS.
Parameters:
InputStream - theInputStream Input stream from database
String - columnDataType Column database type
Returns:
byte[] an array containing the contents of the binary stream.
Since:
JDBCWizard V5.0.2303

unloadBinaryStream

public java.io.File unloadBinaryStream(java.io.File newFile,
                                       java.lang.String theInputString,
                                       java.lang.String columnDataType)
                                throws CSException
Unloads a LONG column into a file
Parameters:
File - newFile File to unload stream into
String - theInputString long column from database
String - columnDataType Column database type

loadCLOB

public static oracle.sql.CLOB loadCLOB(oracle.sql.CLOB newCLOB,
                                       java.io.File theFile,
                                       int bufferSize)
                                throws CSException
Loads a File into a CLOB
Parameters:
File - theFile File to read from
int - bufferSize IO Buffer size in bytes
Returns:
oracle.sql.CLOB newCLOB CLOB to be updated

loadBLOB

public static oracle.sql.BLOB loadBLOB(oracle.sql.BLOB newBLOB,
                                       java.io.File theFile,
                                       int bufferSize)
                                throws CSException
Loads a File into a BLOB
Parameters:
oracle.sql.BLOB - newBLOB BLOB to be updated
byte[] - theArray an array of bytes
Returns:
oracle.sql.BLOB newBLOB

loadCLOB

public static oracle.sql.CLOB loadCLOB(oracle.sql.CLOB newCLOB,
                                       byte[] theArray)
                                throws CSException
Loads a byte array into a CLOB
Parameters:
oracle.sql.CLOB - newCLOB CLOB to be updated
byte[] - theArray an array of bytes
Returns:
oracle.sql.CLOB newCLOB

loadBLOB

public static oracle.sql.BLOB loadBLOB(oracle.sql.BLOB newBLOB,
                                       byte[] theArray)
                                throws CSException
Unloads a byte array to a BLOB
Parameters:
oracle.sql.BLOB - newBLOB BLOB to be updated
byte[] - theArray Array of bytes

loadBFILE

public static oracle.sql.BFILE loadBFILE(oracle.sql.BFILE newBFILE,
                                         java.io.File theFile,
                                         int bufferSize)
                                  throws CSException
Attempts to upload a File to a BFILE This always fails as BFILES are read only.
Parameters:
oracle.sql.BFILEB - newBFILE BFILE to be updated
File - theFile File to read from
int - bufferSize IO Buffer size in bytes
Throws:
CSException - Because BFILEs can not be modified

unloadBfile

public java.io.File unloadBfile(java.io.File newFile,
                                oracle.sql.BFILE tempBFILE)
                         throws CSException
Unloads a BFILE column into a file
Parameters:
File - newFile File to unload stream into
oracle.sql.BFILE - tempBFILE BFILE to unload.

unloadBlob

public java.io.File unloadBlob(java.io.File newFile,
                               oracle.sql.BLOB tempBLOB)
                        throws CSException
Unloads a BLOB column into a file
Parameters:
File - newFile File to unload stream into
oracle.sql.BLOB - tempBLOB BLOB to unload.

unloadClob

public java.io.File unloadClob(java.io.File newFile,
                               oracle.sql.CLOB tempCLOB)
                        throws CSException
Unloads a CLOB column into a file
Parameters:
oracle.sql.CLOB - tempCLOB CLOB to unload.
File - newFile File to unload stream into

unloadBfileIntoByteArray

public byte[] unloadBfileIntoByteArray(oracle.sql.BFILE tempBFILE)
                                throws CSException
Unloads a BFILE column into a byte array
Parameters:
oracle.sql.BFILE - tempBFILE BFILE to unload.
Returns:
byte[] an array of zero or more bytes containing the BFILE
Since:
JDBCWizard V5.0.2303

unloadBlobIntoByteArray

public byte[] unloadBlobIntoByteArray(oracle.sql.BLOB tempBLOB)
                               throws CSException
Unloads a BLOB column into a byte array
Parameters:
oracle.sql.BLOB - tempBLOB BLOB to unload.
Returns:
byte[] an array of zero or more bytes containing the BFILE
Since:
JDBCWizard V5.0.2303

unloadClobIntoByteArray

public byte[] unloadClobIntoByteArray(oracle.sql.CLOB tempCLOB)
                               throws CSException
Unloads a CLOB column into a byte array
Parameters:
oracle.sql.CLOB - tempCLOB CLOB to unload.
Returns:
byte[] an array of zero or more bytes containing the BFILE
Since:
JDBCWizard V5.0.2303

unloadClobIntoCharArray

public char[] unloadClobIntoCharArray(oracle.sql.CLOB tempCLOB)
                               throws CSException
Unloads a CLOB column into a char array
Parameters:
oracle.sql.CLOB - tempCLOB CLOB to unload.
Returns:
byte[] an array of zero or more bytes containing the CLOB
Since:
OrindaBuild V6.0.2765

loadCLOB

public static oracle.sql.CLOB loadCLOB(oracle.sql.CLOB newCLOB,
                                       char[] theArray)
                                throws CSException
Loads a char array into a CLOB
Parameters:
oracle.sql.CLOB - newCLOB CLOB to be updated
char[] - theArray an array of chars
Returns:
oracle.sql.CLOB newCLOB


Copyright © Orinda Software Ltd 2011Logo