All Implemented Interfaces:
Serializable, Cloneable, CorePlatform<ConversionManager>, Platform
Direct Known Subclasses:
Oracle9Platform

public class Oracle8Platform extends OraclePlatform

Purpose: Supports certain new Oracle 8 data types, and usage of certain Oracle JDBC specific APIs.

Supports Oracle thin JDBC driver LOB >4k binding workaround.

Creates BLOB and CLOB type for byte[] and char[] for table creation.

Supports object-relational data-type creation.

See Also:
  • Field Details

    • usesLocatorForLOBWrite

      protected boolean usesLocatorForLOBWrite
      Locator is required for Oracle thin driver to write LOB value exceeds the limits
    • lobValueLimits

      protected int lobValueLimits
      The LOB value limits when the Locator is required for the writing
  • Constructor Details

    • Oracle8Platform

      public Oracle8Platform()
      Default constructor.
  • Method Details

    • buildFieldTypes

      protected Hashtable<Class<?>,FieldTypeDefinition> buildFieldTypes()
      INTERNAL:
      Overrides:
      buildFieldTypes in class OraclePlatform
    • copyInto

      public void copyInto(Platform platform)
      INTERNAL: Allow for conversion from the Oralce type to the Java type.
      Specified by:
      copyInto in interface Platform
      Overrides:
      copyInto in class DatabasePlatform
    • lobValueExceedsLimit

      protected boolean lobValueExceedsLimit(Object value)
      INTERNAL: Return if the LOB value size is larger than the limit, i.e. 4k.
    • getConnection

      public Connection getConnection(AbstractSession session, Connection connection)
      INTERNAL: This method is used to unwrap the oracle connection wrapped by the application server. TopLink needs this unwrapped connection for certain Oracle Specific support. (ie TIMESTAMPTZ, LOB) This is added as a workaround for bug 4565190
      Overrides:
      getConnection in class DatabasePlatform
    • getCustomModifyValueForCall

      public Object getCustomModifyValueForCall(Call call, Object value, DatabaseField field, boolean shouldBind)
      INTERNAL Used by SQLCall.translate(..) Typically there is no field translation (and this is default implementation). However on different platforms (Oracle) there are cases such that the values for binding and appending may be different (BLOB, CLOB). In these special cases the method returns a wrapper object which knows whether it should be bound or appended and knows how to do that.
      Specified by:
      getCustomModifyValueForCall in interface Platform
      Overrides:
      getCustomModifyValueForCall in class DatabasePlatform
    • shouldUseCustomModifyForCall

      public boolean shouldUseCustomModifyForCall(DatabaseField field)
      INTERNAL Used by SQLCall.appendModify(..) If the field should be passed to customModifyInDatabaseCall, retun true, otherwise false. Methods shouldCustomModifyInDatabaseCall and customModifyInDatabaseCall should be kept in sync: shouldCustomModifyInDatabaseCall should return true if and only if the field is handled by customModifyInDatabaseCall.
      Specified by:
      shouldUseCustomModifyForCall in interface Platform
      Overrides:
      shouldUseCustomModifyForCall in class DatabasePlatform
    • writeLOB

      public void writeLOB(DatabaseField field, Object value, ResultSet resultSet, AbstractSession session) throws SQLException
      INTERNAL: Write LOB value - works on Oracle 10 and newer
      Overrides:
      writeLOB in class DatabasePlatform
      Throws:
      SQLException
    • isBlob

      protected boolean isBlob(Class<?> type)
      INTERNAL: Used in writeLOB method only to identify a BLOB
    • isClob

      protected boolean isClob(Class<?> type)
      INTERNAL: Used in writeLOB method only to identify a CLOB
    • isNativeConnectionRequiredForLobLocator

      public boolean isNativeConnectionRequiredForLobLocator()
      INTERNAL: Indicates whether app. server should unwrap connection to use lob locator.
      Overrides:
      isNativeConnectionRequiredForLobLocator in class OraclePlatform
    • setShouldUseLocatorForLOBWrite

      public void setShouldUseLocatorForLOBWrite(boolean usesLocatorForLOBWrite)
      PUBLIC: Set if the locator is required for the LOB write. The default is true. For Oracle thin driver, the locator is recommended for large size ( >4k for Oracle8, >5.9K for Oracle9) BLOB/CLOB value write.
    • shouldUseLocatorForLOBWrite

      public boolean shouldUseLocatorForLOBWrite()
      PUBLIC: Return if the locator is required for the LOB write. The default is true. For Oracle thin driver, the locator is recommended for large size ( >4k for Oracle8, >5.9K for Oracle9) BLOB/CLOB value write.
    • getLobValueLimits

      public int getLobValueLimits()
      PUBLIC: Return the BLOB/CLOB value limits on thin driver. The default value is 0. If usesLocatorForLOBWrite is true, locator will be used in case the lob's size is larger than lobValueLimit.
    • setLobValueLimits

      public void setLobValueLimits(int lobValueLimits)
      PUBLIC: Set the BLOB/CLOB value limits on thin driver. The default value is 0. If usesLocatorForLOBWrite is true, locator will be used in case the lob's size is larger than lobValueLimit.
    • createArray

      public Array createArray(String elementDataTypeName, Object[] elements, Connection connection) throws SQLException
      INTERNAL: Platforms that support java.sql.Array may override this method.
      Overrides:
      createArray in class DatabasePlatform
      Returns:
      Array
      Throws:
      SQLException
    • createStruct

      public Struct createStruct(String structTypeName, Object[] attributes, Connection connection) throws SQLException
      INTERNAL: Platforms that support java.sql.Struct may override this method.
      Overrides:
      createStruct in class DatabasePlatform
      Returns:
      Struct
      Throws:
      SQLException
    • getRefValue

      public Object getRefValue(Ref ref, Connection connection) throws SQLException
      INTERNAL: Overrides DatabasePlatform method.
      Overrides:
      getRefValue in class DatabasePlatform
      Returns:
      String
      Throws:
      SQLException
    • freeTemporaryObject

      public void freeTemporaryObject(Object value) throws SQLException
      INTERNAL: Used by Oracle platforms during reading of ResultSet to free temporary LOBs.
      Overrides:
      freeTemporaryObject in class DatabasePlatform
      Throws:
      SQLException