Skip to content

Most visited

Recently visited

navigation
Added in API level 1

SQLInput

public interface SQLInput

java.sql.SQLInput


The 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 SQLInput methods directly. Reader methods such as readLong and readBytes provide means to read values from an SQLInput stream.

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

See also:

Summary

Public methods

abstract Array readArray()

Returns the next attribute in the stream in the form of a java.sql.Array.

abstract InputStream readAsciiStream()

Returns the next attribute in the stream in the form of an ASCII character stream embodied as a java.io.InputStream.

abstract BigDecimal readBigDecimal()

Returns the next attribute in the stream in the form of a java.math.BigDecimal.

abstract InputStream readBinaryStream()

Returns the next attribute in the stream in the form of a stream of bytes embodied as a java.io.InputStream.

abstract Blob readBlob()

Returns the next attribute in the stream in the form of a java.sql.Blob.

abstract boolean readBoolean()

Returns the next attribute in the stream in the form of a boolean .

abstract byte readByte()

Returns the next attribute in the stream in the form of a byte.

abstract byte[] readBytes()

Returns the next attribute in the stream in the form of a byte array.

abstract Reader readCharacterStream()

Returns the next attribute in the stream in the form of a Unicode character stream embodied as a java.io.Reader.

abstract Clob readClob()

Returns the next attribute in the stream in the form of a java.sql.Clob.

abstract Date readDate()

Returns the next attribute in the stream in the form of a java.sql.Date.

abstract double readDouble()

Returns the next attribute in the stream in the form of a double.

abstract float readFloat()

Returns the next attribute in the stream in the form of a float.

abstract int readInt()

Returns the next attribute in the stream in the form of an int.

abstract long readLong()

Returns the next attribute in the stream in the form of a long.

abstract NClob readNClob()

Returns the next attribute in the stream in the form of a java.sql.NClob.

abstract String readNString()

Returns the next attribute in the stream in the form of a java.lang.String.

abstract Object readObject()

Returns the next attribute in the stream in the form of a java.lang.Object.

abstract Ref readRef()

Returns the next attribute in the stream in the form of a java.sql.Ref.

abstract RowId readRowId()

Returns the next attribute in the stream in the form of a java.sql.RowId.

abstract SQLXML readSQLXML()

Returns the next attribute in the stream in the form of a java.sql.SQLXML.

abstract short readShort()

Returns the next attribute in the stream in the form of a short.

abstract String readString()

Returns the next attribute in the stream in the form of a String.

abstract Time readTime()

Returns the next attribute in the stream in the form of a java.sql.Time.

abstract Timestamp readTimestamp()

Returns the next attribute in the stream in the form of a java.sql.Timestamp.

abstract URL readURL()

Reads the next attribute in the stream (SQL DATALINK value) and returns it as a java.net.URL object.

abstract boolean wasNull()

Reports whether the last value read was SQL NULL.

Public methods

readArray

Added in API level 1
Array readArray ()

Returns the next attribute in the stream in the form of a java.sql.Array.

Returns
Array the next attribute as an Array. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

See also:

readAsciiStream

Added in API level 1
InputStream readAsciiStream ()

Returns the next attribute in the stream in the form of an ASCII character stream embodied as a java.io.InputStream.

Returns
InputStream the next attribute as a java.io.InputStream. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

See also:

readBigDecimal

Added in API level 1
BigDecimal readBigDecimal ()

Returns the next attribute in the stream in the form of a java.math.BigDecimal.

Returns
BigDecimal the attribute as a java.math.BigDecimal. null if the read returns SQL NULL.
Throws
SQLException if there is a database error.

See also:

readBinaryStream

Added in API level 1
InputStream readBinaryStream ()

Returns the next attribute in the stream in the form of a stream of bytes embodied as a java.io.InputStream.

Returns
InputStream the next attribute as a java.io.InputStream. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

See also:

readBlob

Added in API level 1
Blob readBlob ()

Returns the next attribute in the stream in the form of a java.sql.Blob.

Returns
Blob the next attribute as a java.sql.Blob. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

readBoolean

Added in API level 1
boolean readBoolean ()

Returns the next attribute in the stream in the form of a boolean .

Returns
boolean the next attribute as a boolean. false if the value is SQL NULL.
Throws
SQLException if there is a database error.

readByte

Added in API level 1
byte readByte ()

Returns the next attribute in the stream in the form of a byte.

Returns
byte the next attribute as a byte. 0 if the value is SQL NULL.
Throws
SQLException if there is a database error.

readBytes

Added in API level 1
byte[] readBytes ()

Returns the next attribute in the stream in the form of a byte array.

Returns
byte[] the attribute as a byte array. null if the read returns SQL NULL.
Throws
SQLException if there is a database error.

readCharacterStream

Added in API level 1
Reader readCharacterStream ()

Returns the next attribute in the stream in the form of a Unicode character stream embodied as a java.io.Reader.

Returns
Reader the next attribute as a java.io.Reader. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

See also:

readClob

Added in API level 1
Clob readClob ()

Returns the next attribute in the stream in the form of a java.sql.Clob.

Returns
Clob the next attribute as a java.sql.Clob. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

See also:

readDate

Added in API level 1
Date readDate ()

Returns the next attribute in the stream in the form of a java.sql.Date.

Returns
Date the next attribute as a java.sql.Date. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

See also:

readDouble

Added in API level 1
double readDouble ()

Returns the next attribute in the stream in the form of a double.

Returns
double the next attribute as a double. 0 if the value is SQL NULL.
Throws
SQLException if there is a database error.

readFloat

Added in API level 1
float readFloat ()

Returns the next attribute in the stream in the form of a float.

Returns
float the next attribute as a float. 0 if the value is SQL NULL.
Throws
SQLException if there is a database error.

readInt

Added in API level 1
int readInt ()

Returns the next attribute in the stream in the form of an int.

Returns
int the next attribute as an int. 0 if the value is SQL NULL.
Throws
SQLException if there is a database error.

readLong

Added in API level 1
long readLong ()

Returns the next attribute in the stream in the form of a long.

Returns
long the next attribute as a long. 0 if the value is SQL NULL.
Throws
SQLException if there is a database error.

readNClob

Added in API level 9
NClob readNClob ()

Returns the next attribute in the stream in the form of a java.sql.NClob.

Returns
NClob the next attribute as a java.sql.NClob. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

readNString

Added in API level 9
String readNString ()

Returns the next attribute in the stream in the form of a java.lang.String. Used for the NCHAR, NVARCHAR and LONGNVARCHAR types. See readString() otherwise.

Returns
String the next attribute as a java.lang.String. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

readObject

Added in API level 1
Object readObject ()

Returns the next attribute in the stream in the form of a java.lang.Object.

The type of the 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 SQLInput by the JDBC driver before the 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 SQLData.readSQL on it, which reads supplementary data from the stream using whichever protocol is defined for that method.

Returns
Object the next attribute as an Object. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

readRef

Added in API level 1
Ref readRef ()

Returns the next attribute in the stream in the form of a java.sql.Ref.

Returns
Ref the next attribute as a java.sql.Ref. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

See also:

readRowId

Added in API level 9
RowId readRowId ()

Returns the next attribute in the stream in the form of a java.sql.RowId. Used for the ROWID type.

Returns
RowId the next attribute as a java.sql.RowId. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

readSQLXML

Added in API level 9
SQLXML readSQLXML ()

Returns the next attribute in the stream in the form of a java.sql.SQLXML.

Returns
SQLXML the next attribute as a java.sql.SQLXML. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

readShort

Added in API level 1
short readShort ()

Returns the next attribute in the stream in the form of a short.

Returns
short the next attribute as a short. 0 if the value is SQL NULL.
Throws
SQLException if there is a database error.

readString

Added in API level 1
String readString ()

Returns the next attribute in the stream in the form of a String.

Returns
String the next attribute. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

readTime

Added in API level 1
Time readTime ()

Returns the next attribute in the stream in the form of a java.sql.Time.

Returns
Time the attribute as a java.sql.Time. null if the read returns SQL NULL.
Throws
SQLException if there is a database error.

See also:

readTimestamp

Added in API level 1
Timestamp readTimestamp ()

Returns the next attribute in the stream in the form of a java.sql.Timestamp.

Returns
Timestamp the attribute as a java.sql.Timestamp. null if the read returns SQL NULL.
Throws
SQLException if there is a database error.

See also:

readURL

Added in API level 1
URL readURL ()

Reads the next attribute in the stream (SQL DATALINK value) and returns it as a java.net.URL object.

Returns
URL the next attribute as a java.net.URL. null if the value is SQL NULL.
Throws
SQLException if there is a database error.

See also:

wasNull

Added in API level 1
boolean wasNull ()

Reports whether the last value read was SQL NULL.

Returns
boolean true if the last value read was SQL NULL, false otherwise.
Throws
SQLException if there is a database error.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.