Package java.sql
Interface Ref
-
public interface RefThis interface represents an SQL Ref - a data object containing a cursor or pointer to a result table.The data structure identified by an instance of Ref is held in the database, so the data is not necessarily read and converted into a Java object until
getObjectis called. However, if the database supports theReftype, it is not typically necessary to get the underlying object before using it in a method call - theRefobject can be used in place of the data structure.A
Refobject is stored into the database using thePreparedStatement.setRef(int, Ref)method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetBaseTypeName()Gets the fully-qualified SQL name of the SQL structured type that thisRefreferences.ObjectgetObject()Gets the SQL structured type instance referenced by thisRef.ObjectgetObject(Map<String,Class<?>> map)Returns the associated object and uses the relevant mapping to convert it to a Java type.voidsetObject(Object value)Sets the value of the structured type that thisRefreferences to a supplied object.
-
-
-
Method Detail
-
getBaseTypeName
String getBaseTypeName() throws SQLException
Gets the fully-qualified SQL name of the SQL structured type that thisRefreferences.- Returns:
- the fully qualified name of the SQL structured type.
- Throws:
SQLException- if there is a database error.
-
getObject
Object getObject() throws SQLException
Gets the SQL structured type instance referenced by thisRef.- Returns:
- a Java object whose type is defined by the mapping for the SQL structured type.
- Throws:
SQLException- if there is a database error.
-
getObject
Object getObject(Map<String,Class<?>> map) throws SQLException
Returns the associated object and uses the relevant mapping to convert it to a Java type.- Parameters:
map- the mapping for type conversion.- Returns:
- a Java object whose type is defined by the mapping for the SQL structured type.
- Throws:
SQLException- if there is a database error.
-
setObject
void setObject(Object value) throws SQLException
Sets the value of the structured type that thisRefreferences to a supplied object.- Parameters:
value- theObjectrepresenting the new SQL structured type that thisRefreferences.- Throws:
SQLException- if there is a database error.
-
-