Oracle JDBC API Reference
11g Release 2 ("11.2.0.3.0")

oracle.sql
Class OPAQUE

java.lang.Object
  extended by oracle.sql.Datum
      extended by oracle.sql.DatumWithConnection
          extended by oracle.sql.OPAQUE
All Implemented Interfaces:
java.io.Serializable, oracle.jdbc.internal.OracleDatumWithConnection, OracleOpaque

public class OPAQUE
extends DatumWithConnection
implements oracle.jdbc.internal.OracleOpaque

A class for opaque data type.

Since:
8.2
See Also:
Serialized Form

Field Summary
static java.lang.String BUILD_DATE
           
static boolean TRACE
           
 
Constructor Summary
OPAQUE(OpaqueDescriptor type, java.sql.Connection conn, java.lang.Object value)
          Constructor.
 
Method Summary
 byte[] getBytesValue()
          Return a byte array that represents the attributes into the format that is actually used in the database.
 OpaqueDescriptor getDescriptor()
          Oracle extension.
 java.sql.Connection getJavaSqlConnection()
          Oracle extension Return the java.sql.Connection associated with the receiver.
 OracleTypeMetaData getOracleMetaData()
          Return the type data for this object
 java.lang.String getSQLTypeName()
          Implements the Struct interface function Retrieves the SQL type name of the SQL structured type that this Struct object represents.
 java.lang.Object getValue()
          Return the Opaque value.
 boolean isConvertibleTo(java.lang.Class jClass)
          Determines if datum object can be converted to a particular class
 java.lang.String stringValue()
          Convert to a String representation of the datum object
 java.lang.Object toJdbc()
          Returns the JDBC representation of the datum object
 
Methods inherited from class oracle.sql.DatumWithConnection
assertNotNull, assertNotNull, getConnection, getOracleConnection
 
Methods inherited from class oracle.sql.Datum
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, byteValue, characterStreamValue, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, longValue, setBytes, setShareBytes, shareBytes, stringValue, timestampValue, timestampValue, timeValue, timeValue
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jdbc.internal.OracleDatumWithConnection
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, byteValue, characterStreamValue, dateValue, doubleValue, floatValue, getBytes, getConnection, getInternalConnection, getLength, getOracleConnection, getStream, intValue, longValue, setBytes, setPhysicalConnectionOf, setShareBytes, shareBytes, stringValue, timestampValue, timestampValue, timeValue, timeValue
 

Field Detail

BUILD_DATE

public static final java.lang.String BUILD_DATE
See Also:
Constant Field Values

TRACE

public static final boolean TRACE
See Also:
Constant Field Values
Constructor Detail

OPAQUE

public OPAQUE(OpaqueDescriptor type,
              java.sql.Connection conn,
              java.lang.Object value)
       throws java.sql.SQLException
Constructor. The raw bytes are computed at this time or a copy of attributes is made. In any event the caller is free to modify the array without affecting the values held in the OPAQUE.

Parameters:
type - the SQLStructType used to convert the type to
attributes - the array specifying the attributes to be converted to raw bytes.
Throws:
java.sql.SQLException
See Also:
oracle.sql.SQLStructType
Method Detail

getSQLTypeName

public java.lang.String getSQLTypeName()
                                throws java.sql.SQLException
Implements the Struct interface function Retrieves the SQL type name of the SQL structured type that this Struct object represents.

Specified by:
getSQLTypeName in interface OracleOpaque
Throws:
java.sql.SQLException - if a database access error occurs

stringValue

public java.lang.String stringValue()
                             throws java.sql.SQLException
Description copied from class: Datum
Convert to a String representation of the datum object

Specified by:
stringValue in interface oracle.jdbc.internal.OracleDatumWithConnection
Overrides:
stringValue in class Datum
Returns:
String representation of the datum object
Throws:
java.sql.SQLException

getOracleMetaData

public OracleTypeMetaData getOracleMetaData()
                                     throws java.sql.SQLException
Return the type data for this object

Specified by:
getOracleMetaData in interface OracleOpaque
Returns:
type metadata
Throws:
java.sql.SQLException - if an error occurs
Since:
11.2.0.3.0

getDescriptor

public OpaqueDescriptor getDescriptor()
                               throws java.sql.SQLException
Oracle extension. Return the OpaqueDescriptor object that contains the type information.

Returns:
the type descriptor
Throws:
java.sql.SQLException

getValue

public java.lang.Object getValue()
                          throws java.sql.SQLException
Return the Opaque value.

Specified by:
getValue in interface OracleOpaque
Returns:
a Java object that represents the opaque value
Throws:
java.sql.SQLException

getBytesValue

public byte[] getBytesValue()
                     throws java.sql.SQLException
Return a byte array that represents the attributes into the format that is actually used in the database.

Returns:
a byte array that represents the opaque value
Throws:
java.sql.SQLException

isConvertibleTo

public boolean isConvertibleTo(java.lang.Class jClass)
Determines if datum object can be converted to a particular class

Specified by:
isConvertibleTo in interface oracle.jdbc.internal.OracleDatumWithConnection
Specified by:
isConvertibleTo in class Datum
Parameters:
cls - Class to convert to
Returns:
true, if conversion to cls is permitted false, if conversion to cls is not permitted

toJdbc

public java.lang.Object toJdbc()
                        throws java.sql.SQLException
Returns the JDBC representation of the datum object

Specified by:
toJdbc in interface oracle.jdbc.internal.OracleDatumWithConnection
Specified by:
toJdbc in class Datum
Returns:
an object containing the JDBC value
Throws:
java.sql.SQLException - if conversion to JDBC representation results in an error

getJavaSqlConnection

public java.sql.Connection getJavaSqlConnection()
                                         throws java.sql.SQLException
Description copied from class: DatumWithConnection
Oracle extension Return the java.sql.Connection associated with the receiver. Since 9.0.0 not all Oracle JDBC connection objects are assignment compatible with oracle.jdbc.driver.OracleConnection. If the connection is wrapped, return the outermost wrapper.

Specified by:
getJavaSqlConnection in interface oracle.jdbc.internal.OracleDatumWithConnection
Overrides:
getJavaSqlConnection in class DatumWithConnection
Returns:
the connection
Throws:
java.sql.SQLException - if an error occurs

Oracle JDBC API Reference
11g Release 2 ("11.2.0.3.0")

Copyright © 1998, 2007, Oracle. All rights reserved.