home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 2.5 KB | 75 lines |
- /*
- * @(#)SQLData.java 1.3 98/03/18
- *
- * Copyright 1998 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- package java.sql;
-
- /**
- * JDBC 2.0
- *
- * The SQLData interface is implemented by a Java class that is
- * registered in a type mapping.
- */
-
- public interface SQLData {
-
- /**
- * Called by the JDBC driver to determine the name of the
- * SQL user-defined type that is being passed to the database.
- * The JDBC driver must accept an SQLType object that was created
- * by someone else.
- *
- * @returns the SQLType object that was passed to method readSql()
- * when this object was constructed and populated.
- */
- SQLType getSQLType ();
-
- /**
- * Populate this object with data read from the database.
- * The implementation of the method must follow this protocol:
- *
- * Read each of the attributes or elements of the SQL
- * type, by calling a method of the input stream to read each
- * item, in the order that they appear in the SQL definition
- * of the type. Assign those data to appropriate fields or
- * elements (of this or other objects).
- * Specifically, make these method calls:
- * for a Distinct Type: read a single data element.
- * for a Structured Type: read each each attribute of the SQL type.
- *
- * The JDBC driver initializes the input stream with a type map
- * before calling this method which is used by the appropriate
- * readXXX() methods on the stream.
- *
- * @param stream the input SQL data stream
- * @param descriptor the SQL type of the value on the data stream
- */
- void readSQL (SQLInput stream, SQLType descriptor) throws SQLException;
-
- /**
- * Write this object to the given SQL data stream.
- * The implementation of the method must follow this protocol:
- *
- * Write each of the attributes of the SQL type, by calling a
- * method of the output stream to write each item, in the order that
- * they appear in the SQL definition of the type.
- * Specifically, make these method calls:
- * for a Distinct Type: write its single data element.
- * for a Structured Type: write a value for each attribute of the SQL type.
- *
- * @param stream the output SQL data stream
- */
- void writeSQL (SQLOutput stream) throws SQLException;
- }
-
-