home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 6.1 KB | 213 lines |
- /*
- * @(#)SQLInput.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
- *
- * A SQLInput stream contains a stream of values that represent an SQL
- * UDT instance.
- */
-
- public interface SQLInput {
-
-
- //================================================================
- // Methods for reading attributes from the stream of SQL data.
- // These methods correspond to the column-accessor methods of
- // java.sql.ResultSet.
- //================================================================
-
- /**
- * Read the next attribute in the stream as a Java String.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- String readString () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a Java boolean.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- boolean readBoolean () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a Java byte.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- byte readByte () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a Java short.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- short readShort () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a Java int.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- int readInt () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a Java long.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- long readLong () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a Java float.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- float readFloat () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a Java double.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- double readDouble () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a java.math.BigDecimal object.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- java.math.BigDecimal readBigDecimal () throws SQLException;
-
- /**
- * Read the next attribute in the stream as an array of bytes.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- byte[] readBytes () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a java.sql.Date object.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- java.sql.Date readDate () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a java.sql.Time object.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- java.sql.Time readTime () throws SQLException;
-
- /**
- * Read the next attribute in the stream as a java.sql.Timestamp object.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- java.sql.Timestamp readTimestamp () throws SQLException;
-
- /**
- * Return the next attribute in the stream as a stream of Unicode characters.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- java.io.Reader readCharacterStream () throws SQLException;
-
- /**
- * Return the next attribute in the stream as a stream of ASCII characters.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- java.io.InputStream readAsciiStream () throws SQLException;
-
- /**
- * Return the next attribute in the stream as a stream of uninterpreted
- bytes.
- *
- * @return the attribute; if the value is SQL NULL, return null.
- */
- java.io.InputStream readBinaryStream () throws SQLException;
-
- //================================================================
- // Methods for reading items of SQL user-defined types from the stream.
- //================================================================
-
- /**
- * Return an object instance representing an SQL type. The actual type
- * of the object returned is determined by the default type mapping,
- * and any customizations present in this stream's type map.
- *
- * A type map is registered with the stream by the JDBC driver before the
- * stream is passed to the application.
- *
- * Raise exception if the next item in the stream is not a structured or
- * distinct type datum.
- *
- * When the datum at the head of the stream is an SQL NULL,
- * the method returns null. Otherwise, it determines the SQL
- * type of the datum at the head of the stream, constructs an
- * object of the appropriate class, and calls method SQLData.readSQL
- * on that object, which reads additional data from the stream, using
- * the protocol described for SQLData.readSQL.
- *
- */
- Object readObject () throws SQLException;
-
- /**
- * Read a REF(<structured-type>) from the stream.
- *
- * @return an object representing data of an SQL REF Type
- */
- Ref readRef () throws SQLException;
-
- /**
- * Read a LOCATOR(BLOB) from the stream.
- *
- * @return an object representing data of a locator to a BLOB
- */
- BlobLocator ReadBlobLocator () throws SQLException;
-
- /**
- * Read a LOCATOR(CLOB) from the stream.
- *
- * @return an object representing data of a locator to a CLOB
- */
- ClobLocator readClobLocator () throws SQLException;
-
- /**
- * Read a LOCATOR(<structured-type>) from the stream.
- *
- * @return an object representing data of a locator to an instance
- * of a Structured Type
- */
- StructLocator readStructLocator () throws SQLException;
-
- /**
- * Read a LOCATOR(<array>) from the stream.
- *
- * @return an object representing data of a locator to an SQL array
- */
- ArrayLocator readArrayLocator () throws SQLException;
-
- /**
- * @return true iff the most recently gotten SQL value was null.
- *
- */
- boolean wasNull();
- }
-