Oracle8i JDBC Developer's Guide and Reference
Release 3 (8.1.7)

Part Number A83724-01

Library

Product

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

Overview of Object Reference Functionality

To access and update object data through an object reference, you must obtain the reference instance through a result set or callable statement and then pass it back as a bind variable in a prepared statement or callable statement. It is the reference instance that contains the functionality to access and update object attributes.

This section summarizes the following:

Remember that you can use custom reference classes instead of the ARRAY class. See "Custom Reference Classes with JPublisher".

Object Reference Getter and Setter Methods

Use the following result set, callable statement, and prepared statement methods to retrieve and pass object references. Code examples are provided later in the chapter.

Result Set and Callable Statement Getter Methods

The OracleResultSet and OracleCallableStatement classes support getREF() and getRef() methods to retrieve REF objects as output parameters--either as oracle.sql.REF instances or java.sql.Ref instances (oracle.jdbc2.Ref under JDK 1.1.x). You can also use the getObject() method. These methods take as input a String column name or int column index.

Prepared and Callable Statement Setter Methods

The OraclePreparedStatement and OracleCallableStatement classes support setREF() and setRef() methods to take REF objects as bind variables and pass them to the database. You can also use the setObject() method. These methods take as input a String parameter name or int parameter index as well as, respectively, an oracle.sql.REF instance or a java.sql.Ref instance (oracle.jdbc2.Ref under JDK 1.1.x).

Key REF Class Methods

Use the following oracle.sql.REF class methods to retrieve the SQL object type name and retrieve and pass the underlying object data.



Go to previous page
Go to beginning of chapter
Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index