Interface SQLOutput
public interface SQLOutput
When an object which implements the SQLData interface is used as an
argument to an SQL statement, the JDBC driver calls the method
SQLData.getSQLType to establish the type of the SQL UDT that is being
passed. The driver then creates an SQLOutput stream and passes it to
the SQLData.writeSQL method, which in turn uses the appropriate
SQLOutput writer methods to write the data from the SQLData
object into the stream according to the defined mapping.
- See Also:
SQLData
-
Method Summary
Modifier and Type Method Description voidwriteArray(Array theArray)Write an SQLArrayvalue into the output stream.voidwriteAsciiStream(InputStream theStream)Write a stream of ASCII characters into the output stream.voidwriteBigDecimal(BigDecimal theBigDecimal)Write ajava.math.BigDecimalvalue into the output stream.voidwriteBinaryStream(InputStream theStream)Write a stream of uninterpreted bytes into the output stream.voidwriteBlob(Blob theBlob)Write an SQLBlobvalue into the output stream.voidwriteBoolean(boolean theFlag)Write abooleanvalue into the output stream.voidwriteByte(byte theByte)Write abytevalue into the output stream.voidwriteBytes(byte[] theBytes)Write an array of bytes into the output stream.voidwriteCharacterStream(Reader theStream)Write a stream of unicode characters into the output stream.voidwriteClob(Clob theClob)Write an SQLClobvalue into the output stream.voidwriteDate(Date theDate)Write ajava.sql.Datevalue into the output stream.voidwriteDouble(double theDouble)Write adoublevalue into the output stream.voidwriteFloat(float theFloat)Write afloatvalue into the output stream.voidwriteInt(int theInt)Write anintvalue into the output stream.voidwriteLong(long theLong)Write alongvalue into the output stream.voidwriteNClob(NClob theNClob)Write aClobinto the output stream as an SQL NCLOB.voidwriteNString(String theString)Write aStringinto the output stream as an SQL NCHAR, NVARCHAR, or LONGNVARCHAR.voidwriteObject(SQLData theObject)Write anSQLDataobject into the output stream.voidwriteRef(Ref theRef)Write an SQLRefvalue into the output stream.voidwriteRowId(RowId theRowId)Write aRowIdinto the output stream as an SQL ROWID.voidwriteShort(short theShort)Write ashortvalue into the output stream.voidwriteSQLXML(SQLXML theXml)Write aSQLXMLinto the output stream as an SQL XML.voidwriteString(String theString)Write aStringvalue into the output stream.voidwriteStruct(Struct theStruct)Write an SQLStructvalue into the output stream.voidwriteTime(Time theTime)Write ajava.sql.Timevalue into the output stream.voidwriteTimestamp(Timestamp theTimestamp)Write ajava.sql.Timestampvalue into the output stream.voidwriteURL(URL theURL)Write aURLinto the output stream as an SQL DATALINK.
-
Method Details
-
writeString
Write aStringvalue into the output stream.- Parameters:
theString- theStringto write.- Throws:
SQLException- if a database error occurs.
-
writeBoolean
Write abooleanvalue into the output stream.- Parameters:
theFlag- thebooleanvalue to write.- Throws:
SQLException- if a database error occurs.
-
writeByte
Write abytevalue into the output stream.- Parameters:
theByte- thebytevalue to write.- Throws:
SQLException- if a database error occurs.
-
writeShort
Write ashortvalue into the output stream.- Parameters:
theShort- theshortvalue to write.- Throws:
SQLException- if a database error occurs.
-
writeInt
Write anintvalue into the output stream.- Parameters:
theInt- theintvalue to write.- Throws:
SQLException- if a database error occurs.
-
writeLong
Write alongvalue into the output stream.- Parameters:
theLong- thelongvalue to write.- Throws:
SQLException- if a database error occurs.
-
writeFloat
Write afloatvalue into the output stream.- Parameters:
theFloat- thefloatvalue to write.- Throws:
SQLException- if a database error occurs.
-
writeDouble
Write adoublevalue into the output stream.- Parameters:
theDouble- thedoublevalue to write.- Throws:
SQLException- if a database error occurs.
-
writeBigDecimal
Write ajava.math.BigDecimalvalue into the output stream.- Parameters:
theBigDecimal- theBigDecimalvalue to write.- Throws:
SQLException- if a database error occurs.
-
writeBytes
Write an array of bytes into the output stream.- Parameters:
theBytes- the array of bytes to write.- Throws:
SQLException- if a database error occurs.
-
writeDate
Write ajava.sql.Datevalue into the output stream.- Parameters:
theDate- theDatevalue to write.- Throws:
SQLException- if a database error occurs.- See Also:
Date
-
writeTime
Write ajava.sql.Timevalue into the output stream.- Parameters:
theTime- theTimevalue to write.- Throws:
SQLException- if a database error occurs.- See Also:
Time
-
writeTimestamp
Write ajava.sql.Timestampvalue into the output stream.- Parameters:
theTimestamp- theTimestampvalue to write.- Throws:
SQLException- if a database error occurs.- See Also:
Timestamp
-
writeCharacterStream
Write a stream of unicode characters into the output stream.- Parameters:
theStream- the stream of unicode characters to write, as ajava.io.Readerobject.- Throws:
SQLException- if a database error occurs.
-
writeAsciiStream
Write a stream of ASCII characters into the output stream.- Parameters:
theStream- the stream of ASCII characters to write, as ajava.io.InputStreamobject- Throws:
SQLException- if a database error occurs.
-
writeBinaryStream
Write a stream of uninterpreted bytes into the output stream.- Parameters:
theStream- the stream of bytes to write, as ajava.io.InputStreamobject- Throws:
SQLException- if a database error occurs.
-
writeObject
Write anSQLDataobject into the output stream.If the
SQLDataobject is null, writesNULLto the stream.Otherwise, calls the
SQLData.writeSQLmethod of the object, which writes the object's attributes to the stream by calling the appropriate SQLOutput writer methods for each attribute, in order. The order of the attributes is the order they are listed in the SQL definition of the User Defined Type.- Parameters:
theObject- theSQLDataobject to write.- Throws:
SQLException- if a database error occurs.- See Also:
SQLData
-
writeRef
Write an SQLRefvalue into the output stream.- Parameters:
theRef- thejava.sql.Refobject to write.- Throws:
SQLException- if a database error occurs.- See Also:
Ref
-
writeBlob
Write an SQLBlobvalue into the output stream.- Parameters:
theBlob- thejava.sql.Blobobject to write.- Throws:
SQLException- if a database error occurs.- See Also:
Blob
-
writeClob
Write an SQLClobvalue into the output stream.- Parameters:
theClob- thejava.sql.Clobobject to write.- Throws:
SQLException- if a database error occurs.- See Also:
Clob
-
writeStruct
Write an SQLStructvalue into the output stream.- Parameters:
theStruct- thejava.sql.Structobject to write.- Throws:
SQLException- if a database error occurs.- See Also:
Struct
-
writeArray
Write an SQLArrayvalue into the output stream.- Parameters:
theArray- thejava.sql.Arrayobject to write.- Throws:
SQLException- if a database error occurs.- See Also:
Array
-
writeURL
Write aURLinto the output stream as an SQL DATALINK.- Parameters:
theURL- the datalink value as ajava.net.URLto write.- Throws:
SQLException- if a database error occurs.- See Also:
URL
-
writeNString
Write aStringinto the output stream as an SQL NCHAR, NVARCHAR, or LONGNVARCHAR.- Parameters:
theString- theStringto write.- Throws:
SQLException- if a database error occurs.
-
writeNClob
Write aClobinto the output stream as an SQL NCLOB.- Parameters:
theNClob- thejava.sql.Clobobject to write.- Throws:
SQLException- if a database error occurs.
-
writeRowId
Write aRowIdinto the output stream as an SQL ROWID.- Parameters:
theRowId- thejava.sql.RowIdobject to write.- Throws:
SQLException- if a database error occurs.
-
writeSQLXML
Write aSQLXMLinto the output stream as an SQL XML.- Parameters:
theXml- thejava.sql.SQLXMLobject to write.- Throws:
SQLException- if a database error occurs.
-