com.onewebsql.query.adapter
Class PostgresDBAdapter

java.lang.Object
  extended by com.onewebsql.query.adapter.BaseDBAdapter
      extended by com.onewebsql.query.adapter.PostgresDBAdapter
All Implemented Interfaces:
DBAdapter

public class PostgresDBAdapter
extends BaseDBAdapter

Implementation of DBAdapter interface for the PostgreSQL database.


Field Summary
 
Fields inherited from class com.onewebsql.query.adapter.BaseDBAdapter
DEFAULT_VALUE_LIST_PARAMETER_HANDLER, LOB_BURST_SIZE, NEXT_VALUE_FOR, SEQUENCE_ROW_HANDLER
 
Constructor Summary
PostgresDBAdapter()
          Constructor.
 
Method Summary
 Long getNextId(String sequenceName, String schemaName, DataSource ds)
          Returns the next value from the sequence with the specified name and the specified schema name, from the specified data source.
 void setBlob(DataSource ds, String schemaName, Column column, Object id, InputStream is, long length)
          Reads from the specified stream and writes its contents to the Blob column.
 
Methods inherited from class com.onewebsql.query.adapter.BaseDBAdapter
buildIdWhere, buildQuery, getBlob, getClob, getValueListParameterHandler, join, setClob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostgresDBAdapter

public PostgresDBAdapter()
Constructor.

Method Detail

getNextId

public Long getNextId(String sequenceName,
                      String schemaName,
                      DataSource ds)
Returns the next value from the sequence with the specified name and the specified schema name, from the specified data source. The sequence should be created by the SQL script which creates the database structure.

Specified by:
getNextId in interface DBAdapter
Overrides:
getNextId in class BaseDBAdapter
Parameters:
sequenceName - sequence name
schemaName - name of the schema
ds - data source
Returns:
next value of the sequence

setBlob

public void setBlob(DataSource ds,
                    String schemaName,
                    Column column,
                    Object id,
                    InputStream is,
                    long length)
Reads from the specified stream and writes its contents to the Blob column. The specified row must exist in the database. The row identifier might be This implementation uses the PostgresBlob class.

Specified by:
setBlob in interface DBAdapter
Overrides:
setBlob in class BaseDBAdapter
Parameters:
ds - data source
schemaName - name of the table's schema
column - column to which we are writing
id - row id
is - InputStream containing data to write or null if the column is to be set to NULL
length - the number of bytes to write or -1 if the whole stream content is to be written


Copyright © 2011-2013 e-point SA. All Rights Reserved.