com.informix.jdbc

## Interface IfmxUDTSQLOutput

All Superinterfaces:
  java.sql.SQLOutput, SQLUDTOutput

All Known Implementing Classes:
  IfxUDTOutput

    public interface IfmxUDTSQLOutput
    extends java.sql.SQLOutput, SQLUDTOutput

The IfmxUDTSQLOutput interface extends the SQLOutput interface. This interface is specifically for Informix user-defined types. It contains Informix extension methods for serializing fixed-length data.

### Method Summary

Methods
`int` `available()` Returns the number of valid bytes remaining in this output stream.
`boolean` `getAutoAlignment()` Returns true if auto alignment is enabled and false if auto alignment has been disabled.
`int` `getCurrentPosition()` Returns the current position in the output stream.
`IfxUDTInfo` `getUDTInfo(int xid)` Get general information about opaque and distinct types and detailed information for complex types.
`IfxUDTInfo` `getUDTInfo(java.lang.String name, java.lang.String owner)` Get general information about opaque and distinct types and detailed information for complex types.
`int` `length()` Gets the total length written to the data stream.
`void` `setAutoAlignment(boolean value)` Enable or disable automatic alignment.
`void` `setCurrentPosition(int position)` Resets the current position.
`void` `skipBytes(int len)` Skips over and discards len bytes of data from the output stream.
`void` `writeBytes(byte[] b, int length)` Writes the next attribute to the stream as a Java byte array.
`void` `writeInterval(Interval intrvl)` Writes the next attribute to the stream as a Java Interval.
`void` `writeString(java.lang.String x, int length)` Writes the next attribute to the stream as a Java String.

### Methods inherited from interface java.sql.SQLOutput

`writeArray, writeAsciiStream, writeBigDecimal, writeBinaryStream, writeBlob, writeBoolean, writeByte, writeBytes, writeCharacterStream, writeClob, writeDate, writeDouble, writeFloat, writeInt, writeLong, writeNClob, writeNString, writeObject, writeRef, writeRowId, writeShort, writeSQLXML, writeString, writeStruct, writeTime, writeTimestamp, writeURL`

### Method Detail

#### writeString

    void writeString(java.lang.String x,
                   int length)
                     throws java.sql.SQLException

Writes the next attribute to the stream as a Java String. This method is similar to SQLOutput.writeString(), except that it writes a fixed length of data to the stream. If the String passed in is shorter than the specified length, the driver zero-pads the string. This method replaces SQLOutput.writeString() in the UDT implementation. Since the user-defined type is unknown to the driver, the user MUST supply a length in order for the driver to write the next attribute properly.

Specified by:
  `writeString` in interface `SQLUDTOutput`
Parameters:
  `x` - The value to pass to the database.
  `length` - The length of the specified field.
Throws:
  `java.sql.SQLException`

#### writeBytes

    void writeBytes(byte[] b,
                  int length)
                    throws java.sql.SQLException

Writes the next attribute to the stream as a Java byte array. This method is similar to SQLOutput.writeBytes(), except that it writes a fixed length of data to the stream. If the array passed in is shorter than the specified length, the driver zero-pads the array. This method replaces SQLOutput.writeBytes() in the UDT implementation. Since the user-defined type is unknown to the driver, the user MUST supply a length in order for the driver to write the next attribute properly.

Specified by:
  `writeBytes` in interface `SQLUDTOutput`
Parameters:
  `b` - The value to be passed to the database.
  `length` - The length of the specified field.
Throws:
  `java.sql.SQLException`

#### writeInterval

    void writeInterval(Interval intrvl)
                       throws java.sql.SQLException

Writes the next attribute to the stream as a Java Interval. This method is an Informix extension.

Specified by:
  `writeInterval` in interface `SQLUDTOutput`
Parameters:
  `intrvl` - The interval to be passed to the database.
Throws:
  `java.sql.SQLException`

#### length

    int length()

Gets the total length written to the data stream.

Returns:
  The total length.

#### setAutoAlignment

    void setAutoAlignment(boolean value)

Enable or disable automatic alignment. The default is that the driver automatically handles alignment between data fields.

Parameters:
  `value` - = true then alignment should be handles automatically. If value = false then no alignment is done. It's the user's respon- sibility to call skipBytes(int) to handle alignment.

#### getAutoAlignment

    boolean getAutoAlignment()

Returns true if auto alignment is enabled and false if auto alignment has been disabled.

Returns:
  true if auto alignment is enabled.

#### skipBytes

    void skipBytes(int len)
                   throws java.sql.SQLException

Skips over and discards len bytes of data from the output stream. alignment has been disabled.

Parameters:
  `len` - Number of bytes to skip over and discard.
Throws:
  `java.sql.SQLException`

#### getCurrentPosition

    int getCurrentPosition()

Returns the current position in the output stream.

Returns:
  Returns the current position.

#### setCurrentPosition

    void setCurrentPosition(int position)
                            throws java.sql.SQLException

Resets the current position.

Parameters:
  `position` -
Throws:
  `java.sql.SQLException`

#### available

    int available()

Returns the number of valid bytes remaining in this output stream. This will always return 0 unless the user has called setCurrentPosition().

Returns:
  Returns the number of bytes available in the output stream

#### getUDTInfo

    IfxUDTInfo getUDTInfo(int xid)
                          throws java.sql.SQLException

Get general information about opaque and distinct types and detailed information for complex types. Calls IfmxConnection.getUDTInfo(int)

Parameters:
  `xid` - Is the extended id found in sysxtdtype system catalog.
Returns:
  The detailed type information as an Informix IfxUDTInfo.
Throws:
  `java.sql.SQLException`

#### getUDTInfo

    IfxUDTInfo getUDTInfo(java.lang.String name,
                        java.lang.String owner)
                          throws java.sql.SQLException

Get general information about opaque and distinct types and detailed information for complex types. Calls IfmxConnection.getUDTInfo(String name, String owner)

Parameters:
  `name` - The data type name.
  `owner` - The owner of the data type (can be null).
Returns:
  The detailed type information as an Informix IfxUDTInfo.
Throws:
  `java.sql.SQLException`