Top Description Methods
org.jooq

public Interface Formattable

Known Direct Subinterfaces
org.jooq.Record, org.jooq.Cursor, org.jooq.Result
Known Direct Implementers
org.jooq.impl.AbstractFormattable
Imports
java.io.OutputStream, .Writer, java.sql.ResultSet, org.jooq.exception.IOException, org.jetbrains.annotations.NotNull, org.w3c.dom.Document, org.xml.sax.ContentHandler, .SAXException

A type that can format its contents.

This type provides a common interface for Result and Cursor formatting functionality, which includes formatting results to:

Calling formatting methods on a Result is repeatable as the Result has been previously materialised in memory and the database resource is closed. Calling these methods on a Cursor is not repeatable as the Cursor (and the underlying JDBC ResultSet) is consumed entirely, and closed eagerly after consumption.

Author
Lukas Eder

Method Summary

Modifier and TypeMethod and Description
public @NotNull String

Returns:

The formatted result
format
()

Get a simple formatted representation of this result.

public @NotNull String

Returns:

The formatted result
format
(int
The maximum number of records to include in the formatted result
maxRecords
)

Get a simple formatted representation of this result.

public @NotNull String

Returns:

The formatted result
format
(TXTFormat
The formatting information
format
)

Get a simple formatted representation of this result.

public void
format(OutputStream stream)

Like format(), but the data is output onto an OutputStream.

public void
format(OutputStream stream, int maxRecords)

Like format(int), but the data is output onto an OutputStream.

public void
format(OutputStream stream, TXTFormat format)

Like format(TXTFormat), but the data is output onto an OutputStream.

public void
format(Writer writer)

Like format(), but the data is output onto a Writer.

public void
format(Writer writer, int maxRecords)

Like format(int), but the data is output onto a Writer.

public void
format(Writer writer, TXTFormat format)

Like format(TXTFormat), but the data is output onto a Writer.

public @NotNull String
formatChart()

Get this result as an ASCII chart.

public @NotNull String
formatChart(ChartFormat format)

Get this result as an ASCII chart.

public void
formatChart(OutputStream stream)

Like formatChart(), but the data is output onto an OutputStream.

public void
formatChart(OutputStream stream, ChartFormat format)

Like formatChart(ChartFormat), but the data is output onto an OutputStream.

public void
formatChart(Writer writer)

Like formatChart(), but the data is output onto a Writer.

public void
formatChart(Writer writer, ChartFormat format)

Like formatChart(ChartFormat), but the data is output onto a Writer.

public @NotNull String

Returns:

The formatted result
formatCSV
()

Get a simple formatted representation of this result as CSV.

public @NotNull String

Returns:

The formatted result
formatCSV
(char
The delimiter to use between records
delimiter
)

Get a simple formatted representation of this result as CSV.

public @NotNull String

Returns:

The formatted result
formatCSV
(char
The delimiter to use between records
delimiter
,
String
A special string for encoding NULL values.
nullString
)

Get a simple formatted representation of this result as CSV.

public @NotNull String

Returns:

The formatted result
formatCSV
(boolean
Whether to emit a CSV header line
header
)

Get a simple formatted representation of this result as CSV.

public @NotNull String

Returns:

The formatted result
formatCSV
(boolean
Whether to emit a CSV header line
header
,
char
The delimiter to use between records
delimiter
)

Get a simple formatted representation of this result as CSV.

public @NotNull String

Returns:

The formatted result
formatCSV
(boolean
Whether to emit a CSV header line
header
,
char
The delimiter to use between records
delimiter
,
String
A special string for encoding NULL values.
nullString
)

Get a simple formatted representation of this result as CSV.

public @NotNull String

Returns:

The formatted result
formatCSV
(CSVFormat format)

Get a simple formatted representation of this result as CSV.

public void
formatCSV(OutputStream stream)

Like formatCSV(), but the data is output onto an OutputStream.

public void
formatCSV(OutputStream stream, char delimiter)

Like formatCSV(char), but the data is output onto an OutputStream.

public void
formatCSV(OutputStream stream, char delimiter, String nullString)

Like formatCSV(char, String), but the data is output onto an OutputStream.

public void
formatCSV(OutputStream stream, boolean header)

Like formatCSV(boolean), but the data is output onto an OutputStream.

public void
formatCSV(OutputStream stream, boolean header, char delimiter)

Like formatCSV(boolean, char), but the data is output onto an OutputStream.

public void
formatCSV(OutputStream stream, boolean header, char delimiter, String nullString)

Like formatCSV(boolean, char, String), but the data is output onto an OutputStream.

public void
formatCSV(OutputStream stream, CSVFormat format)

Like formatCSV(CSVFormat), but the data is output onto an OutputStream.

public void
formatCSV(Writer writer)

Like formatCSV(), but the data is output onto a Writer.

public void
formatCSV(Writer writer, char delimiter)

Like formatCSV(char), but the data is output onto a Writer.

public void
formatCSV(Writer writer, char delimiter, String nullString)

Like formatCSV(char, String), but the data is output onto a Writer.

public void
formatCSV(Writer writer, boolean header)

Like formatCSV(boolean), but the data is output onto a Writer.

public void
formatCSV(Writer writer, boolean header, char delimiter)

Like formatCSV(boolean, char), but the data is output onto a Writer.

public void
formatCSV(Writer writer, boolean header, char delimiter, String nullString)

Like formatCSV(boolean, char, String), but the data is output onto a Writer.

public void
formatCSV(Writer writer, CSVFormat format)

Like formatCSV(CSVFormat), but the data is output onto a Writer.

public @NotNull String

Returns:

The formatted result
formatHTML
()

Get a simple formatted representation of this result as HTML.

public void
formatHTML(OutputStream stream)

Like formatHTML(), but the data is output onto an OutputStream.

public void
formatHTML(Writer writer)

Like formatHTML(), but the data is output onto a Writer.

public @NotNull String
formatInsert()

Get this result as a set of INSERT statements.

public @NotNull String
formatInsert(Table<?> table, Field<?>... fields)

Deprecated as a consequence of Field being deprecated.
Get this result as a set of INSERT statements.
public void
formatInsert(OutputStream stream)

Like formatInsert(), but the data is output onto an OutputStream.

public void
formatInsert(OutputStream stream, Table<?> table, Field<?>... fields)

Deprecated as a consequence of Field being deprecated.
Like formatInsert(Table, Field...), but the data is output onto an OutputStream.
public void
formatInsert(Writer writer)

Like formatInsert(), but the data is output onto a Writer.

public void
formatInsert(Writer writer, Table<?> table, Field<?>... fields)

Deprecated as a consequence of Field being deprecated.
Like formatInsert(Table, Field...), but the data is output onto an Writer.
public @NotNull String

Returns:

The formatted result
formatJSON
()

Get a simple formatted representation of this result as a JSON array of array.

public @NotNull String

Returns:

The formatted result
formatJSON
(JSONFormat format)

Get a simple formatted representation of this result as a JSON data structure, according to the format.

public void
formatJSON(OutputStream stream)

Like formatJSON(), but the data is output onto an OutputStream.

public void
formatJSON(OutputStream stream, JSONFormat format)

Like formatJSON(JSONFormat), but the data is output onto an OutputStream.

public void
formatJSON(Writer writer)

Like formatJSON(), but the data is output onto a Writer.

public void
formatJSON(Writer writer, JSONFormat format)

Like formatJSON(JSONFormat), but the data is output onto a Writer.

public @NotNull String
formatXML()

Get this result formatted as XML.

public @NotNull String
formatXML(XMLFormat format)

Get this result formatted as XML.

public void
formatXML(OutputStream stream)

Like formatXML(), but the data is output onto an OutputStream.

public void
formatXML(OutputStream stream, XMLFormat format)

Like formatXML(XMLFormat), but the data is output onto an OutputStream.

public void
formatXML(Writer writer)

Like formatXML(), but the data is output onto a Writer.

public void
formatXML(Writer writer, XMLFormat format)

Like formatXML(XMLFormat), but the data is output onto a Writer.

public @NotNull Document
intoXML()

Get this result as XML.

public @NotNull Document
intoXML(XMLFormat format)

Get this result as XML.

public <H extends ContentHandler> H

Returns:

The argument content handler is returned for convenience.
intoXML
(H
The custom content handler.
handler
)

Get this result as XML using a SAX ContentHandler.

public <H extends ContentHandler> H

Returns:

The argument content handler is returned for convenience.
intoXML
(H
The custom content handler.
handler
,
XMLFormat format)

Get this result as XML using a SAX ContentHandler.