java.sql
Interface SQLOutput

All Known Implementing Classes:
SQLOutputImpl sample code for javax.sql.rowset.serial.SQLOutputImpl definition code for javax.sql.rowset.serial.SQLOutputImpl

public interface SQLOutput

The output stream for writing the attributes of a user-defined type back to the database. This interface, used only for custom mapping, is used by the driver, and its methods are never directly invoked by a programmer.

When an object of a class implementing the interface SQLData is passed as an argument to an SQL statement, the JDBC driver calls the method SQLData.getSQLType to determine the kind of SQL datum being passed to the database. The driver then creates an instance of SQLOutput and passes it to the method SQLData.writeSQL. The method writeSQL in turn calls the appropriate SQLOutput writer methods writeBoolean, writeCharacterStream, and so on) to write data from the SQLData object to the SQLOutput output stream as the representation of an SQL user-defined type.

Since:
1.2

Method Summary
 void writeArray sample code for java.sql.SQLOutput.writeArray(java.sql.Array) definition code for java.sql.SQLOutput.writeArray(java.sql.Array) (Array sample code for java.sql.Array definition code for java.sql.Array  x)
          Writes an SQL ARRAY value to the stream.
 void writeAsciiStream sample code for java.sql.SQLOutput.writeAsciiStream(java.io.InputStream) definition code for java.sql.SQLOutput.writeAsciiStream(java.io.InputStream) (InputStream sample code for java.io.InputStream definition code for java.io.InputStream  x)
          Writes the next attribute to the stream as a stream of ASCII characters.
 void writeBigDecimal sample code for java.sql.SQLOutput.writeBigDecimal(java.math.BigDecimal) definition code for java.sql.SQLOutput.writeBigDecimal(java.math.BigDecimal) (BigDecimal sample code for java.math.BigDecimal definition code for java.math.BigDecimal  x)
          Writes the next attribute to the stream as a java.math.BigDecimal object.
 void writeBinaryStream sample code for java.sql.SQLOutput.writeBinaryStream(java.io.InputStream) definition code for java.sql.SQLOutput.writeBinaryStream(java.io.InputStream) (InputStream sample code for java.io.InputStream definition code for java.io.InputStream  x)
          Writes the next attribute to the stream as a stream of uninterpreted bytes.
 void writeBlob sample code for java.sql.SQLOutput.writeBlob(java.sql.Blob) definition code for java.sql.SQLOutput.writeBlob(java.sql.Blob) (Blob sample code for java.sql.Blob definition code for java.sql.Blob  x)
          Writes an SQL BLOB value to the stream.
 void writeBoolean sample code for java.sql.SQLOutput.writeBoolean(boolean) definition code for java.sql.SQLOutput.writeBoolean(boolean) (boolean x)
          Writes the next attribute to the stream as a Java boolean.
 void writeByte sample code for java.sql.SQLOutput.writeByte(byte) definition code for java.sql.SQLOutput.writeByte(byte) (byte x)
          Writes the next attribute to the stream as a Java byte.
 void writeBytes sample code for java.sql.SQLOutput.writeBytes(byte[]) definition code for java.sql.SQLOutput.writeBytes(byte[]) (byte[] x)
          Writes the next attribute to the stream as an array of bytes.
 void writeCharacterStream sample code for java.sql.SQLOutput.writeCharacterStream(java.io.Reader) definition code for java.sql.SQLOutput.writeCharacterStream(java.io.Reader) (Reader sample code for java.io.Reader definition code for java.io.Reader  x)
          Writes the next attribute to the stream as a stream of Unicode characters.
 void writeClob sample code for java.sql.SQLOutput.writeClob(java.sql.Clob) definition code for java.sql.SQLOutput.writeClob(java.sql.Clob) (Clob sample code for java.sql.Clob definition code for java.sql.Clob  x)
          Writes an SQL CLOB value to the stream.
 void writeDate sample code for java.sql.SQLOutput.writeDate(java.sql.Date) definition code for java.sql.SQLOutput.writeDate(java.sql.Date) (Date sample code for java.sql.Date definition code for java.sql.Date  x)
          Writes the next attribute to the stream as a java.sql.Date object.
 void writeDouble sample code for java.sql.SQLOutput.writeDouble(double) definition code for java.sql.SQLOutput.writeDouble(double) (double x)
          Writes the next attribute to the stream as a Java double.
 void writeFloat sample code for java.sql.SQLOutput.writeFloat(float) definition code for java.sql.SQLOutput.writeFloat(float) (float x)
          Writes the next attribute to the stream as a Java float.
 void writeInt sample code for java.sql.SQLOutput.writeInt(int) definition code for java.sql.SQLOutput.writeInt(int) (int x)
          Writes the next attribute to the stream as a Java int.
 void writeLong sample code for java.sql.SQLOutput.writeLong(long) definition code for java.sql.SQLOutput.writeLong(long) (long x)
          Writes the next attribute to the stream as a Java long.
 void writeObject sample code for java.sql.SQLOutput.writeObject(java.sql.SQLData) definition code for java.sql.SQLOutput.writeObject(java.sql.SQLData) (SQLData sample code for java.sql.SQLData definition code for java.sql.SQLData  x)
          Writes to the stream the data contained in the given SQLData object.
 void writeRef sample code for java.sql.SQLOutput.writeRef(java.sql.Ref) definition code for java.sql.SQLOutput.writeRef(java.sql.Ref) (Ref sample code for java.sql.Ref definition code for java.sql.Ref  x)
          Writes an SQL REF value to the stream.
 void writeShort sample code for java.sql.SQLOutput.writeShort(short) definition code for java.sql.SQLOutput.writeShort(short) (short x)
          Writes the next attribute to the stream as a Java short.
 void writeString sample code for java.sql.SQLOutput.writeString(java.lang.String) definition code for java.sql.SQLOutput.writeString(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  x)
          Writes the next attribute to the stream as a String in the Java programming language.
 void writeStruct sample code for java.sql.SQLOutput.writeStruct(java.sql.Struct) definition code for java.sql.SQLOutput.writeStruct(java.sql.Struct) (Struct sample code for java.sql.Struct definition code for java.sql.Struct  x)
          Writes an SQL structured type value to the stream.
 void writeTime sample code for java.sql.SQLOutput.writeTime(java.sql.Time) definition code for java.sql.SQLOutput.writeTime(java.sql.Time) (Time sample code for java.sql.Time definition code for java.sql.Time  x)
          Writes the next attribute to the stream as a java.sql.Time object.
 void writeTimestamp sample code for java.sql.SQLOutput.writeTimestamp(java.sql.Timestamp) definition code for java.sql.SQLOutput.writeTimestamp(java.sql.Timestamp) (Timestamp sample code for java.sql.Timestamp definition code for java.sql.Timestamp  x)
          Writes the next attribute to the stream as a java.sql.Timestamp object.
 void writeURL sample code for java.sql.SQLOutput.writeURL(java.net.URL) definition code for java.sql.SQLOutput.writeURL(java.net.URL) (URL sample code for java.net.URL definition code for java.net.URL  x)
          Writes a SQL DATALINK value to the stream.
 

Method Detail

writeString sample code for java.sql.SQLOutput.writeString(java.lang.String) definition code for java.sql.SQLOutput.writeString(java.lang.String)

void writeString(String sample code for java.lang.String definition code for java.lang.String  x)
                 throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a String in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeBoolean sample code for java.sql.SQLOutput.writeBoolean(boolean) definition code for java.sql.SQLOutput.writeBoolean(boolean)

void writeBoolean(boolean x)
                  throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a Java boolean. Writes the next attribute to the stream as a String in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeByte sample code for java.sql.SQLOutput.writeByte(byte) definition code for java.sql.SQLOutput.writeByte(byte)

void writeByte(byte x)
               throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a Java byte. Writes the next attribute to the stream as a String in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeShort sample code for java.sql.SQLOutput.writeShort(short) definition code for java.sql.SQLOutput.writeShort(short)

void writeShort(short x)
                throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a Java short. Writes the next attribute to the stream as a String in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeInt sample code for java.sql.SQLOutput.writeInt(int) definition code for java.sql.SQLOutput.writeInt(int)

void writeInt(int x)
              throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a Java int. Writes the next attribute to the stream as a String in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeLong sample code for java.sql.SQLOutput.writeLong(long) definition code for java.sql.SQLOutput.writeLong(long)

void writeLong(long x)
               throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a Java long. Writes the next attribute to the stream as a String in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeFloat sample code for java.sql.SQLOutput.writeFloat(float) definition code for java.sql.SQLOutput.writeFloat(float)

void writeFloat(float x)
                throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a Java float. Writes the next attribute to the stream as a String in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeDouble sample code for java.sql.SQLOutput.writeDouble(double) definition code for java.sql.SQLOutput.writeDouble(double)

void writeDouble(double x)
                 throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a Java double. Writes the next attribute to the stream as a String in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeBigDecimal sample code for java.sql.SQLOutput.writeBigDecimal(java.math.BigDecimal) definition code for java.sql.SQLOutput.writeBigDecimal(java.math.BigDecimal)

void writeBigDecimal(BigDecimal sample code for java.math.BigDecimal definition code for java.math.BigDecimal  x)
                     throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a java.math.BigDecimal object. Writes the next attribute to the stream as a String in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeBytes sample code for java.sql.SQLOutput.writeBytes(byte[]) definition code for java.sql.SQLOutput.writeBytes(byte[])

void writeBytes(byte[] x)
                throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as an array of bytes. Writes the next attribute to the stream as a String in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeDate sample code for java.sql.SQLOutput.writeDate(java.sql.Date) definition code for java.sql.SQLOutput.writeDate(java.sql.Date)

void writeDate(Date sample code for java.sql.Date definition code for java.sql.Date  x)
               throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a java.sql.Date object. Writes the next attribute to the stream as a java.sql.Date object in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeTime sample code for java.sql.SQLOutput.writeTime(java.sql.Time) definition code for java.sql.SQLOutput.writeTime(java.sql.Time)

void writeTime(Time sample code for java.sql.Time definition code for java.sql.Time  x)
               throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a java.sql.Time object. Writes the next attribute to the stream as a java.sql.Date object in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeTimestamp sample code for java.sql.SQLOutput.writeTimestamp(java.sql.Timestamp) definition code for java.sql.SQLOutput.writeTimestamp(java.sql.Timestamp)

void writeTimestamp(Timestamp sample code for java.sql.Timestamp definition code for java.sql.Timestamp  x)
                    throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a java.sql.Timestamp object. Writes the next attribute to the stream as a java.sql.Date object in the Java programming language.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeCharacterStream sample code for java.sql.SQLOutput.writeCharacterStream(java.io.Reader) definition code for java.sql.SQLOutput.writeCharacterStream(java.io.Reader)

void writeCharacterStream(Reader sample code for java.io.Reader definition code for java.io.Reader  x)
                          throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a stream of Unicode characters.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeAsciiStream sample code for java.sql.SQLOutput.writeAsciiStream(java.io.InputStream) definition code for java.sql.SQLOutput.writeAsciiStream(java.io.InputStream)

void writeAsciiStream(InputStream sample code for java.io.InputStream definition code for java.io.InputStream  x)
                      throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a stream of ASCII characters.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeBinaryStream sample code for java.sql.SQLOutput.writeBinaryStream(java.io.InputStream) definition code for java.sql.SQLOutput.writeBinaryStream(java.io.InputStream)

void writeBinaryStream(InputStream sample code for java.io.InputStream definition code for java.io.InputStream  x)
                       throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes the next attribute to the stream as a stream of uninterpreted bytes.

Parameters:
x - the value to pass to the database
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeObject sample code for java.sql.SQLOutput.writeObject(java.sql.SQLData) definition code for java.sql.SQLOutput.writeObject(java.sql.SQLData)

void writeObject(SQLData sample code for java.sql.SQLData definition code for java.sql.SQLData  x)
                 throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes to the stream the data contained in the given SQLData object. When the SQLData object is null, this method writes an SQL NULL to the stream. Otherwise, it calls the SQLData.writeSQL method of the given object, which writes the object's attributes to the stream. The implementation of the method SQLData.writeSQ calls the appropriate SQLOutput writer method(s) for writing each of the object's attributes in order. The attributes must be read from an SQLInput input stream and written to an SQLOutput output stream in the same order in which they were listed in the SQL definition of the user-defined type.

Parameters:
x - the object representing data of an SQL structured or distinct type
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeRef sample code for java.sql.SQLOutput.writeRef(java.sql.Ref) definition code for java.sql.SQLOutput.writeRef(java.sql.Ref)

void writeRef(Ref sample code for java.sql.Ref definition code for java.sql.Ref  x)
              throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes an SQL REF value to the stream.

Parameters:
x - a Ref object representing data of an SQL REF value
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeBlob sample code for java.sql.SQLOutput.writeBlob(java.sql.Blob) definition code for java.sql.SQLOutput.writeBlob(java.sql.Blob)

void writeBlob(Blob sample code for java.sql.Blob definition code for java.sql.Blob  x)
               throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes an SQL BLOB value to the stream.

Parameters:
x - a Blob object representing data of an SQL BLOB value
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeClob sample code for java.sql.SQLOutput.writeClob(java.sql.Clob) definition code for java.sql.SQLOutput.writeClob(java.sql.Clob)

void writeClob(Clob sample code for java.sql.Clob definition code for java.sql.Clob  x)
               throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes an SQL CLOB value to the stream.

Parameters:
x - a Clob object representing data of an SQL CLOB value
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeStruct sample code for java.sql.SQLOutput.writeStruct(java.sql.Struct) definition code for java.sql.SQLOutput.writeStruct(java.sql.Struct)

void writeStruct(Struct sample code for java.sql.Struct definition code for java.sql.Struct  x)
                 throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes an SQL structured type value to the stream.

Parameters:
x - a Struct object representing data of an SQL structured type
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeArray sample code for java.sql.SQLOutput.writeArray(java.sql.Array) definition code for java.sql.SQLOutput.writeArray(java.sql.Array)

void writeArray(Array sample code for java.sql.Array definition code for java.sql.Array  x)
                throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes an SQL ARRAY value to the stream.

Parameters:
x - an Array object representing data of an SQL ARRAY type
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs

writeURL sample code for java.sql.SQLOutput.writeURL(java.net.URL) definition code for java.sql.SQLOutput.writeURL(java.net.URL)

void writeURL(URL sample code for java.net.URL definition code for java.net.URL  x)
              throws SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
Writes a SQL DATALINK value to the stream.

Parameters:
x - a java.net.URL object representing the data of SQL DATALINK type
Throws:
SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException - if a database access error occurs
Since:
1.4