gate.db
Class PostgresDataStore

java.lang.Object
  |
  +--gate.util.AbstractFeatureBearer
        |
        +--gate.persist.SerialDataStore
              |
              +--gate.db.Database
                    |
                    +--gate.db.PostgresDataStore
All Implemented Interfaces:
DataStore, FeatureBearer

public class PostgresDataStore
extends Database

Provides connection to an Oracle Database.


Fields inherited from class gate.db.Database
TRANSACTION_LEVEL
 
Constructor Summary
PostgresDataStore(Driver driver, String url, String user, String password, String catalog, String schema)
          Constructs a OracleDataStore
 
Method Summary
 Map getDictionary()
           
 void putObject(PreparedStatement ps, int place, Object value)
          Acts as a setBlob for the provided prepared statement on the position indicated by place.
 Object readObjectBlob(ResultSet rs, Connection con, String columnName)
          Reads a Object from a BLOB on the current row in a result set.
 
Methods inherited from class gate.db.Database
deleteFeaturesOf, getCatalog, getConnection, getFeatures, getSchema, isConnected, readFeaturesOf, release, setFeatures, takeBackConnection, writeFeaturesOf
 
Methods inherited from class gate.persist.SerialDataStore
addDatastoreListener, adopt, close, create, delete, delete, equals, getLr, getLrIds, getLrName, getLrNames, getLrTypes, getStorageDir, getStorageUrl, hashCode, isAutoSaving, open, removeDatastoreListener, setAutoSaving, setStorageDir, setStorageUrl, sync, toString
 
Methods inherited from class gate.util.AbstractFeatureBearer
getName, setName
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gate.util.FeatureBearer
getName, setName
 

Constructor Detail

PostgresDataStore

public PostgresDataStore(Driver driver,
                         String url,
                         String user,
                         String password,
                         String catalog,
                         String schema)
                  throws SQLException
Constructs a OracleDataStore
Parameters:
driver - the driver used to connect to the database. We didn't choose to default this value to any specific Oracle Jdbc drivers because this option should belong to the user.
url - The URL of the database.
user - the username
password - the password
catalog - the catalog in which the Gate2 table reside.
schema - The schema in which the Gate2 table reside.
Method Detail

readObjectBlob

public Object readObjectBlob(ResultSet rs,
                             Connection con,
                             String columnName)
                      throws SQLException,
                             IOException
Reads a Object from a BLOB on the current row in a result set. Note that the Blob must contain a java Object saved using serialisation.
Overrides:
readObjectBlob in class Database
Parameters:
rs - a result set positioned on the row from which the BLOB is to be read
columnName - the name of the column containing the BLOB on the current row.
Returns:
an object containing the blob.

putObject

public void putObject(PreparedStatement ps,
                      int place,
                      Object value)
               throws SQLException,
                      IOException
Acts as a setBlob for the provided prepared statement on the position indicated by place. Uses Postgresql extensions.
Overrides:
putObject in class Database
Parameters:
ps - A prepared statement where the blob will be set.
place - The position on the prepared statement where the blob will be set.
value - The object that will be serialised and converted into a blob.

getDictionary

public Map getDictionary()
Overrides:
getDictionary in class Database