javax.sql.rowset.serial
Class SerialRef

java.lang.Object
  extended byjavax.sql.rowset.serial.SerialRef
All Implemented Interfaces:
java.lang.Cloneable, java.sql.Ref, java.io.Serializable

public class SerialRef
extends java.lang.Object
implements java.sql.Ref, java.io.Serializable, java.lang.Cloneable

A serializable mapping between the SQL REF type and the Java programming language.

The SerialRef class provides a constructor for creating a SerialRef instance from a Ref type, and provides methods for gettinga nd setting the Ref object type.

See Also:
Serialized Form

Constructor Summary
SerialRef(java.sql.Ref ref)
          Constructs the SerialRef object given any Ref object instance.
 
Method Summary
 java.lang.String getBaseTypeName()
          Returns a string describing the base type name of the Ref.
 java.lang.Object getObject()
          Returns an object resolved from the stored Ref reference.
 java.lang.Object getObject(java.util.Map map)
          Returns an object mapped according to the supplied type mapping from the resolved Ref reference.
 void setObject(java.lang.Object obj)
          Set object to be referenced.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerialRef

public SerialRef(java.sql.Ref ref)
          throws SerialException,
                 java.sql.SQLException
Constructs the SerialRef object given any Ref object instance.

Parameters:
ref - a Ref object instance; cannot be null
Throws:
java.sql.SQLException - if a database access occurs or if the ref value is null.
SerialException - if an error occurs serializing the Ref object.
Method Detail

getBaseTypeName

public java.lang.String getBaseTypeName()
                                 throws SerialException
Returns a string describing the base type name of the Ref.

Specified by:
getBaseTypeName in interface java.sql.Ref
Returns:
a string of the base type name of the Ref
Throws:
SerialException - in no Ref object has been set

getObject

public java.lang.Object getObject(java.util.Map map)
                           throws SerialException
Returns an object mapped according to the supplied type mapping from the resolved Ref reference.

Specified by:
getObject in interface java.sql.Ref
Parameters:
map - a java.util.Map object containing zero or more entries, with each entry consisting of 1) a String giving the fully qualified name of a UDT and 2) the Class object for the SQLData implementation that defines how the UDT is to be mapped
Returns:
an object instance resolved from the Ref reference and mapped according to the supplied type map
Throws:
SerialException - if an error is encountered in the reference resolution

getObject

public java.lang.Object getObject()
                           throws SerialException
Returns an object resolved from the stored Ref reference.

Specified by:
getObject in interface java.sql.Ref
Returns:
an object instance resolve from the Ref refernce
Throws:
SerialException - if an error is encounter in the reference resolution

setObject

public void setObject(java.lang.Object obj)
               throws SerialException
Set object to be referenced.

Specified by:
setObject in interface java.sql.Ref
Parameters:
obj - object instance to be referenced.
Throws:
SerialException - if an error is encountered generating the the reference for this object