3.2.4: 2013-12-06

net.sf.basedb.core.migrate.postgres
Class PostgresResultWriterFactory

java.lang.Object
  extended by 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
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 Summary
PostgresResultWriterFactory()
           
 
Method Summary
 ResultWriter create(ResultSet rs, int index, Writer writer, TableInfo.ColumnInfo column)
          Create a new result writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_ESCAPE

private final char[] NULL_ESCAPE
PostgreSQL uses "\N" for null values.


dateFormat

private final DateFormat dateFormat
PostgreSQL uses 'yyyy-MM-dd' for dates.


timestampFormat

private final DateFormat timestampFormat
PostgreSQL uses 'yyyy-MM-dd HH:mm:ss' for timestamps.


BINARY_ESCAPE

private char[][] BINARY_ESCAPE

CHAR_ESCAPE

private char[][] CHAR_ESCAPE
Constructor Detail

PostgresResultWriterFactory

public PostgresResultWriterFactory()
Method Detail

create

public ResultWriter create(ResultSet rs,
                           int index,
                           Writer writer,
                           TableInfo.ColumnInfo column)
Description copied from interface: ResultWriterFactory
Create a new result writer.

Specified by:
create in interface ResultWriterFactory
Parameters:
rs - The result set that data should be taken from
index - The column index that the writer should read date from
writer - The writer to write the formatted output to
column - More information about the column that the writer should read from
Returns:
A result writer implementation

3.2.4: 2013-12-06