Package oracle.sql
Class STRUCT
- java.lang.Object
-
- oracle.sql.Datum
-
- oracle.sql.DatumWithConnection
-
- oracle.sql.STRUCT
-
- All Implemented Interfaces:
Serializable,Struct,oracle.jdbc.internal.ACProxyable,oracle.jdbc.internal.OracleConcreteProxy,oracle.jdbc.internal.OracleDatumWithConnection,oracle.jdbc.internal.OracleStruct,OracleStruct
- Direct Known Subclasses:
JAVA_STRUCT
public class STRUCT extends DatumWithConnection implements oracle.jdbc.internal.OracleStruct, oracle.jdbc.internal.OracleConcreteProxy
Deprecated.Use java.sql.Struct interface for declaration instead of using concrete class oracle.sql.STRUCT.This class has two roles.- It is the Oracle implementation class for the generic JDBC Struct interface.
- It wraps the "raw bytes" of an Oracle Object Type.
Structinterface for declaration instead of using concrete class oracle.sql.STRUCT. java.sql.Struct has methods declared for all opertions. For Oracle specific methods use the interfaceOracleStruct.Obtaining a Struct from the ResultSet
java.sql.Struct struct = resultSet.getStruct(...);Creating a Struct using factory method
Connection.createStruct(java.lang.String, java.lang.Object[])java.sql.Struct struct = connection.createStruct(...);
-
<section role="region">
-
Field Summary
Fields Modifier and Type Field Description protected oracle.jdbc.driver.OracleStructtargetDeprecated.-
Fields inherited from class oracle.sql.DatumWithConnection
targetDatumWithConnection
-
Fields inherited from class oracle.sql.Datum
ojiOracleDatumWithConnection, targetDatum
-
-
Constructor Summary
Constructors Constructor Description STRUCT(StructDescriptor type, Connection conn, Object[] attributes)Deprecated.Constructor.STRUCT(StructDescriptor type, Connection conn, Map attrList)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Stringdump()Deprecated.Create a string which show the contents of this Object and of all its component parts.static voiddump(Object o, PrintStream ps)Deprecated.static voiddump(Object o, PrintWriter pw)Deprecated.Object[]getAttributes()Deprecated.Implements the Struct interface function.Object[]getAttributes(Map map)Deprecated.Implements the Struct interface function.booleangetAutoBuffering()Deprecated.Performance hint.Datum[]getDatumArray()Deprecated.StructDescriptorgetDescriptor()Deprecated.Oracle extension.ConnectiongetJavaSqlConnection()Deprecated.Oracle extension Return the java.sql.Connection associated with the receiver.Object[]getObjectArray()Deprecated.Datum[]getOracleAttributes()Deprecated.Oracle extension.OracleDataFactorygetOracleDataFactory(Hashtable map, String classname)Deprecated.OracleTypeMetaDatagetOracleMetaData()Deprecated.Return the type data for this objectStringgetSQLTypeName()Deprecated.Implements the Struct interface function Retrieves the SQL type name of the SQL structured type that thisStructobject represents.oracle.jdbc.driver.OracleStructgetTarget()Deprecated.booleanisConvertibleTo(Class jClass)Deprecated.Determines if datum object can be converted to a particular classvoidsetAutoBuffering(boolean enable)Deprecated.Performance hint.voidsetNullDatumArray()Deprecated.Set the variable null.voidsetNullObjectArray()Deprecated.Set the variable null.ObjecttoJdbc()Deprecated.Oracle extension.ObjecttoJdbc(Map map)Deprecated.Oracle extension.-
Methods inherited from class oracle.sql.DatumWithConnection
assertNotNull, assertNotNull, getConnection, getConnectionDuringExceptionHandling, getOracleConnection
-
Methods inherited from class oracle.sql.Datum
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, bytesEqual, bytesHashCode, byteValue, characterStreamValue, compareBytes, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, isNull, longValue, setBytes, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue
-
Methods inherited from class java.lang.Object
clone, finalize, 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, stringValue, timestampValue, timestampValue, timeValue, timeValue
-
-
-
<section role="region">
</section>
<section role="region">
-
Constructor Detail
-
STRUCT
public STRUCT(StructDescriptor type, Connection conn, Object[] attributes) throws SQLException
Deprecated.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 STRUCT. For inherited object types we must check that the descriptor indicates that the type is instantiable. That database does not check on e.g. insertion but only on PL/SQL object creation. So we have to check here, too. There is an argument to be made that there is a good use for the STRUCT instance to carry data around and that the error ought to be when an insertion or udpate is attempted. But this keeps the "not instantiable" rather than "not storable" notion. And is is much more simple.- Parameters:
type- the SQLStructType used to convert the type toattributes- the array specifying the attributes to be converted to raw bytes.- Throws:
SQLException- See Also:
oracle.sql.SQLStructType
-
STRUCT
public STRUCT(StructDescriptor type, Connection conn, Map attrList) throws SQLException
Deprecated.- Throws:
SQLException
-
-
Method Detail
-
getTarget
public oracle.jdbc.driver.OracleStruct getTarget()
Deprecated.
-
getSQLTypeName
public String getSQLTypeName() throws SQLException
Deprecated.Implements the Struct interface function Retrieves the SQL type name of the SQL structured type that thisStructobject represents.- Specified by:
getSQLTypeNamein interfaceStruct- Returns:
- the fully-qualified type name of the SQL structured type for which this
Structobject is the generic representation - Throws:
SQLException- if a database access error occurs
-
getAttributes
public Object[] getAttributes() throws SQLException
Deprecated.Implements the Struct interface function. Produces the ordered values of the attributes of the SQL structure type that thisStructobject represents. Each call returns a fresh array. This method uses the type map associated with the connection for customizations of the type mappings. If there is no entry in the connection's type map that matches the structured type that thisStructobject represents, the driver uses the standard mapping.Conceptually, this method calls the method
getObjecton each attribute of the structured type and returns a Java array containing the result.- Specified by:
getAttributesin interfaceStruct- Returns:
- an array containing the ordered attribute values
- Throws:
SQLException- if a database access error occurs
-
getAttributes
public Object[] getAttributes(Map map) throws SQLException
Deprecated.Implements the Struct interface function. Produces the ordered values of the attributes of the SQL structurec type that thisStructobject represents. Each call returns a fresh array. This method uses the given type map for customizations of the type mappings. If there is no entry in the given type map that matches the structured type that thisStructobject represents, the driver uses the standard mapping.Conceptually, this method calls the method
getObjecton each attribute of the structured type and returns a Java array containing the result.- Specified by:
getAttributesin interfaceStruct- Parameters:
map- a mapping of SQL type names to Java classes- Returns:
- an array containing the ordered attribute values
- Throws:
SQLException- if a database access error occurs
-
getOracleMetaData
public OracleTypeMetaData getOracleMetaData() throws SQLException
Deprecated.Return the type data for this object- Specified by:
getOracleMetaDatain interfaceOracleStruct- Returns:
- type metadata
- Throws:
SQLException- if an error occurs- Since:
- 11.2.0.3.0
-
getDescriptor
public StructDescriptor getDescriptor() throws SQLException
Deprecated.Oracle extension. Return the StructDescriptor object that contains the type information.- Specified by:
getDescriptorin interfaceoracle.jdbc.internal.OracleStruct- Returns:
- the type descriptor
- Throws:
SQLException
-
getOracleAttributes
public Datum[] getOracleAttributes() throws SQLException
Deprecated.Oracle extension. Retrun the array of Attributes as oracle.sql.XXX's. A fresh array is returned each time getOracleAttributes is called.- Specified by:
getOracleAttributesin interfaceoracle.jdbc.internal.OracleStruct- Returns:
- Datum array that containing the ordered attribute values as oracle.sql.Datum objects.
- Throws:
SQLException
-
getDatumArray
public Datum[] getDatumArray()
Deprecated.- Specified by:
getDatumArrayin interfaceoracle.jdbc.internal.OracleStruct
-
setNullDatumArray
public void setNullDatumArray()
Deprecated.Set the variable null. (INTERNAL)- Specified by:
setNullDatumArrayin interfaceoracle.jdbc.internal.OracleStruct
-
getObjectArray
public Object[] getObjectArray()
Deprecated.- Specified by:
getObjectArrayin interfaceoracle.jdbc.internal.OracleStruct
-
setNullObjectArray
public void setNullObjectArray()
Deprecated.Set the variable null. (INTERNAL)- Specified by:
setNullObjectArrayin interfaceoracle.jdbc.internal.OracleStruct
-
toJdbc
public Object toJdbc() throws SQLException
Deprecated.Oracle extension. Returns the JDBC representation of the datum object- Specified by:
toJdbcin interfaceoracle.jdbc.internal.OracleDatumWithConnection- Specified by:
toJdbcin interfaceoracle.jdbc.internal.OracleStruct- Specified by:
toJdbcin classDatum- Returns:
- an object containing the JDBC value
- Throws:
SQLException- if conversion to JDBC representation results in an error
-
toJdbc
public Object toJdbc(Map map) throws SQLException
Deprecated.Oracle extension. Consults the map to determine what class to convert to, and then uses toClass- Specified by:
toJdbcin interfaceoracle.jdbc.internal.OracleStruct- Throws:
SQLException
-
isConvertibleTo
public boolean isConvertibleTo(Class jClass)
Deprecated.Determines if datum object can be converted to a particular class- Specified by:
isConvertibleToin interfaceoracle.jdbc.internal.OracleDatumWithConnection- Specified by:
isConvertibleToin interfaceoracle.jdbc.internal.OracleStruct- Specified by:
isConvertibleToin classDatum- Parameters:
cls- Class to convert to- Returns:
- true, if conversion to cls is permitted false, if conversion to cls is not permitted
-
setAutoBuffering
public void setAutoBuffering(boolean enable) throws SQLExceptionDeprecated.Performance hint. Sets this struct's auto-buffering mode. If a struct is in auto-buffering mode, then the struct will keep a local copy of all its attributes. Then the next access to the same attributes will return a cloned copy. Otherwise, type conversion for each element is required. By default, a STRUCT is NOT in auto-buffering mode.- Specified by:
setAutoBufferingin interfaceoracle.jdbc.internal.OracleStruct- Parameters:
enable- - true enables auto-buffering; false disables auto-buffering- Throws:
SQLException- Since:
- 8.1.7
- See Also:
getAutoBuffering()
-
getAutoBuffering
public boolean getAutoBuffering() throws SQLExceptionDeprecated.Performance hint. Get the current auto-buffering state.- Specified by:
getAutoBufferingin interfaceoracle.jdbc.internal.OracleStruct- Returns:
- the current state of auto-buffering
- Throws:
SQLException- Since:
- 8.1.7
- See Also:
setAutoBuffering(boolean)
-
getOracleDataFactory
public OracleDataFactory getOracleDataFactory(Hashtable map, String classname) throws SQLException
Deprecated.- Throws:
SQLException
-
getJavaSqlConnection
public Connection getJavaSqlConnection() throws SQLException
Deprecated.Description copied from class:DatumWithConnectionOracle 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:
getJavaSqlConnectionin interfaceoracle.jdbc.internal.OracleDatumWithConnection- Specified by:
getJavaSqlConnectionin interfaceoracle.jdbc.internal.OracleStruct- Overrides:
getJavaSqlConnectionin classDatumWithConnection- Returns:
- the connection
- Throws:
SQLException- if an error occurs
-
dump
public String dump() throws SQLException
Deprecated.Create a string which show the contents of this Object and of all its component parts.- Throws:
SQLException
-
dump
public static void dump(Object o, PrintStream ps) throws SQLException
Deprecated.- Throws:
SQLException
-
dump
public static void dump(Object o, PrintWriter pw) throws SQLException
Deprecated.- Throws:
SQLException
-
-