Class LongObjectLoader

java.lang.Object
com.mcpdbwizard.pub.LongObjectLoader

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

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

Copyright 2003-2026 ATB Consultancy Services Ltd (formerly Orinda Software Ltd, Dublin, Ireland)

Version:
7
Author:
[email protected]
  • Constructor Summary

    Constructors
    Constructor
    Description
    This utility class is used to get LOB objects into and out of the database.
  • Method Summary

    Modifier and Type
    Method
    Description
    static oracle.sql.BFILE
    loadBFILE(oracle.sql.BFILE newBFILE, 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, 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, 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.
    unloadBfile(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
    unloadBinaryStream(File newFile, InputStream theInputStream, String columnDataType)
    Unloads a Binary Stream into a file
    unloadBinaryStream(File newFile, String theInputString, String columnDataType)
    Unloads a LONG column into a file
    byte[]
    unloadBinaryStreamIntoByteArray(InputStream theInputStream, String columnDataType)
    Unloads a Binary Stream into a byte array.
    unloadBlob(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
    unloadClob(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[]
    Unloads a CLOB column into a char array
    char[]
    unloadClobIntoCharArray(oracle.sql.CLOB tempCLOB)
    Unloads a CLOB column into a char array

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LongObjectLoader

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

    • loadCLOB

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

      public static oracle.sql.BLOB loadBLOB(oracle.sql.BLOB newBLOB, File theFile, int bufferSize) throws CSException
      Loads a File into a BLOB
      Parameters:
      newBLOB - BLOB to be updated
      theFile - The file to load into the BLOB
      Returns:
      oracle.sql.BLOB newBLOB
      Throws:
      CSException
    • loadCLOB

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

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

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

      public static oracle.sql.CLOB loadCLOB(oracle.sql.CLOB newCLOB, char[] theArray) throws CSException
      Loads a char array into a CLOB
      Parameters:
      newCLOB - CLOB to be updated
      theArray - an array of chars
      Returns:
      oracle.sql.CLOB newCLOB
      Throws:
      CSException
    • 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 File unloadBinaryStream(File newFile, InputStream theInputStream, String columnDataType) throws CSException
      Unloads a Binary Stream into a file
      Parameters:
      newFile - File to unload stream into
      theInputStream - Input stream from database
      columnDataType - Column database type
      Throws:
      CSException
    • unloadBinaryStreamIntoByteArray

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

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

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

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

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

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

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

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

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

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