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.
Field Summary |
private static boolean |
DEBUG
Debug flag |
protected Map |
dictionary
|
(package private) postgresql.largeobject.LargeObjectManager |
lobMan
|
Methods inherited from class gate.db.Database |
connect, deleteFeaturesOf, getCatalog, getConnection, getFeatures, getSchema, isConnected, readFeaturesOf, release, setFeatures, takeBackConnection, writeFeaturesOf |
Methods inherited from class gate.persist.SerialDataStore |
addDatastoreListener, adopt, close, constructPersistenceId, create, delete, delete, equals, fireResourceAdopted, fireResourceDeleted, fireResourceWritten, getLr, getLrIds, getLrName, getLrNames, getLrTypes, getStorageDir, getStorageUrl, getVersionFile, hashCode, isAutoSaving, isValidProtocolVersion, open, random, removeDatastoreListener, setAutoSaving, setStorageDir, setStorageUrl, sync, toString |
DEBUG
private static final boolean DEBUG
- Debug flag
dictionary
protected Map dictionary
lobMan
postgresql.largeobject.LargeObjectManager lobMan
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 usernamepassword
- the passwordcatalog
- the catalog in which the Gate2 table reside.schema
- The schema in which the Gate2 table reside.
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 readcolumnName
- 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