Class PostgresResultWriterFactory
java.lang.Object
net.sf.basedb.core.migrate.postgres.PostgresResultWriterFactory
- All Implemented Interfaces:
ResultWriterFactory
public class PostgresResultWriterFactory extends Object implements ResultWriterFactory
Result writer factory implementation for formatting
result values suitable for importing by a PostgreSQL
database.
- Since:
- 3.1
- Author:
- nicklas
-
Field Summary
Fields Modifier and Type Field Description private char[][]
BINARY_ESCAPE
private char[][]
CHAR_ESCAPE
private org.apache.commons.lang3.time.FastDateFormat
dateFormat
PostgreSQL uses 'yyyy-MM-dd' for dates.private char[]
NULL_ESCAPE
PostgreSQL uses "\N" for null values.private org.apache.commons.lang3.time.FastDateFormat
timestampFormat
PostgreSQL uses 'yyyy-MM-dd HH:mm:ss' for timestamps. -
Constructor Summary
Constructors Constructor Description PostgresResultWriterFactory()
-
Method Summary
Modifier and Type Method Description ResultWriter
create(ResultSet rs, int index, Writer writer, TableInfo.ColumnInfo column)
Create a new result writer.
-
Field Details
-
NULL_ESCAPE
private final char[] NULL_ESCAPEPostgreSQL uses "\N" for null values. -
dateFormat
private final org.apache.commons.lang3.time.FastDateFormat dateFormatPostgreSQL uses 'yyyy-MM-dd' for dates. -
timestampFormat
private final org.apache.commons.lang3.time.FastDateFormat timestampFormatPostgreSQL uses 'yyyy-MM-dd HH:mm:ss' for timestamps. -
BINARY_ESCAPE
private char[][] BINARY_ESCAPE -
CHAR_ESCAPE
private char[][] CHAR_ESCAPE
-
-
Constructor Details
-
PostgresResultWriterFactory
public PostgresResultWriterFactory()
-
-
Method Details
-
create
Description copied from interface:ResultWriterFactory
Create a new result writer.- Specified by:
create
in interfaceResultWriterFactory
- Parameters:
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- Returns:
- A result writer implementation
-