public class PostgresResultWriterFactory extends Object implements ResultWriterFactory
Modifier and Type | Field and Description |
---|---|
private char[][] |
BINARY_ESCAPE |
private char[][] |
CHAR_ESCAPE |
private DateFormat |
dateFormat
PostgreSQL uses 'yyyy-MM-dd' for dates.
|
private char[] |
NULL_ESCAPE
PostgreSQL uses "\N" for null values.
|
private DateFormat |
timestampFormat
PostgreSQL uses 'yyyy-MM-dd HH:mm:ss' for timestamps.
|
Constructor and Description |
---|
PostgresResultWriterFactory() |
Modifier and Type | Method and Description |
---|---|
ResultWriter |
create(ResultSet rs,
int index,
Writer writer,
TableInfo.ColumnInfo column)
Create a new result writer.
|
private final char[] NULL_ESCAPE
private final DateFormat dateFormat
private final DateFormat timestampFormat
private char[][] BINARY_ESCAPE
private char[][] CHAR_ESCAPE
public ResultWriter create(ResultSet rs, int index, Writer writer, TableInfo.ColumnInfo column)
ResultWriterFactory
create
in interface ResultWriterFactory
rs
- The result set that data should be taken fromindex
- The column index that the writer should read date fromwriter
- The writer to write the formatted output tocolumn
- More information about the column that the writer should
read from