FileDocCategorySizeDatePackage
SQLInput.javaAPI DocAndroid 1.5 API12092Wed May 06 22:41:06 BST 2009java.sql

SQLInput

public interface SQLInput
The {@code SQLInput} interface defines operations which apply to a type of input stream which carries a series of values representing an instance of an SQL structured type or SQL distinct type.

This interface is used to define custom mappings of SQL User Defined Types (UDTs) to Java classes. It is used by JDBC drivers, therefore application programmers do not normally use the {@code SQLInput} methods directly. Reader methods such as {@code readLong} and {@code readBytes} provide means to read values from an {@code SQLInput} stream.

When the {@code getObject} method is called with an object which implements the {@code SQLData} interface, the JDBC driver determines the SQL type of the UDT being mapped by calling the {@code SQLData.getSQLType} method. The driver creates an instance of an {@code SQLInput} stream, filling the stream with the attributes of the UDT. The {@code SQLInput} stream is passed to the {@code SQLData.readSQL} method which then calls the {@code SQLInput} reader methods to read the attributes.

see
SQLData
since
Android 1.0

Fields Summary
Constructors Summary
Methods Summary
public java.sql.ArrayreadArray()
Returns the next attribute in the stream in the form of a {@code java.sql.Array}.

return
the next attribute as an {@code Array}. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
see
Array
since
Android 1.0

public java.io.InputStreamreadAsciiStream()
Returns the next attribute in the stream in the form of an ASCII character stream embodied as a {@code java.io.InputStream}.

return
the next attribute as a {@code java.io.InputStream}. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
see
java.io.InputStream
since
Android 1.0

public java.math.BigDecimalreadBigDecimal()
Returns the next attribute in the stream in the form of a {@code java.math.BigDecimal}.

return
the attribute as a {@code java.math.BigDecimal}. {@code null} if the read returns SQL {@code NULL}.
throws
SQLException if there is a database error.
see
java.math.BigDecimal
since
Android 1.0

public java.io.InputStreamreadBinaryStream()
Returns the next attribute in the stream in the form of a stream of bytes embodied as a {@code java.io.InputStream}.

return
the next attribute as a {@code java.io.InputStream}. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
see
java.io.InputStream
since
Android 1.0

public java.sql.BlobreadBlob()
Returns the next attribute in the stream in the form of a {@code java.sql.Blob}.

return
the next attribute as a {@code java.sql.Blob}. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public booleanreadBoolean()
Returns the next attribute in the stream in the form of a {@code boolean} .

return
the next attribute as a {@code boolean}. {@code false} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public bytereadByte()
Returns the next attribute in the stream in the form of a {@code byte}.

return
the next attribute as a {@code byte}. 0 if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public byte[]readBytes()
Returns the next attribute in the stream in the form of a byte array.

return
the attribute as a byte array. {@code null} if the read returns SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public java.io.ReaderreadCharacterStream()
Returns the next attribute in the stream in the form of a Unicode character stream embodied as a {@code java.io.Reader}.

return
the next attribute as a {@code java.io.Reader}. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
see
java.io.Reader
since
Android 1.0

public java.sql.ClobreadClob()
Returns the next attribute in the stream in the form of a {@code java.sql.Clob}.

return
the next attribute as a {@code java.sql.Clob}. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
see
Clob
since
Android 1.0

public java.sql.DatereadDate()
Returns the next attribute in the stream in the form of a {@code java.sql.Date}.

return
the next attribute as a {@code java.sql.Date}. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
see
Date
since
Android 1.0

public doublereadDouble()
Returns the next attribute in the stream in the form of a {@code double}.

return
the next attribute as a {@code double}. 0 if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public floatreadFloat()
Returns the next attribute in the stream in the form of a {@code float}.

return
the next attribute as a {@code float}. 0 if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public intreadInt()
Returns the next attribute in the stream in the form of an {@code int}.

return
the next attribute as an {@code int}. 0 if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public longreadLong()
Returns the next attribute in the stream in the form of a {@code long}.

return
the next attribute as a {@code long}. 0 if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public java.lang.ObjectreadObject()
Returns the next attribute in the stream in the form of a {@code java.lang.Object}.

The type of the {@code Object} returned is determined by the type mapping for this JDBC driver, including any customized mappings, if present. A type map is given to the {@code SQLInput} by the JDBC driver before the {@code SQLInput} is given to the application.

If the attribute is an SQL structured or distinct type, its SQL type is determined. If the stream's type map contains an element for that SQL type, the driver creates an object for the relevant type and invokes the method {@code SQLData.readSQL} on it, which reads supplementary data from the stream using whichever protocol is defined for that method.

return
the next attribute as an Object. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public java.sql.RefreadRef()
Returns the next attribute in the stream in the form of a {@code java.sql.Ref}.

return
the next attribute as a {@code java.sql.Ref}. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
see
Ref
since
Android 1.0

public shortreadShort()
Returns the next attribute in the stream in the form of a {@code short}.

return
the next attribute as a {@code short}. 0 if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public java.lang.StringreadString()
Returns the next attribute in the stream in the form of a {@code String}.

return
the next attribute. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
since
Android 1.0

public java.sql.TimereadTime()
Returns the next attribute in the stream in the form of a {@code java.sql.Time}.

return
the attribute as a {@code java.sql.Time}. {@code null} if the read returns SQL {@code NULL}.
throws
SQLException if there is a database error.
see
Time
since
Android 1.0

public java.sql.TimestampreadTimestamp()
Returns the next attribute in the stream in the form of a {@code java.sql.Timestamp}.

return
the attribute as a {@code java.sql.Timestamp}. {@code null} if the read returns SQL {@code NULL}.
throws
SQLException if there is a database error.
see
Timestamp
since
Android 1.0

public java.net.URLreadURL()
Reads the next attribute in the stream (SQL DATALINK value) and returns it as a {@code java.net.URL} object.

return
the next attribute as a {@code java.net.URL}. {@code null} if the value is SQL {@code NULL}.
throws
SQLException if there is a database error.
see
java.net.URL
since
Android 1.0

public booleanwasNull()
Reports whether the last value read was SQL {@code NULL}.

return
{@code true} if the last value read was SQL {@code NULL}, {@code false} otherwise.
throws
SQLException if there is a database error.
since
Android 1.0