|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.AbstractDataSource
org.geotools.data.jdbc.JDBCDataSource
This class provides a skeletal implementation of the DataSource interface to minimize the effort of required to implement this interface.
Nested Class Summary |
Nested classes inherited from class org.geotools.data.AbstractDataSource |
AbstractDataSource.MetaDataSupport |
Field Summary | |
protected java.sql.Connection |
transConn
A postgis connection. |
Fields inherited from class org.geotools.data.AbstractDataSource |
supportMsg |
Constructor Summary | |
JDBCDataSource(ConnectionPool pool)
|
Method Summary | |
protected void |
closeTransactionConnection()
This method should be called when a connection retrieved using getTransactionConnection is to be closed. |
void |
commit()
Makes all transactions made since the previous commit/rollback permanent. |
protected DataSourceMetaData |
createMetaData()
Creates the a metaData object. |
protected void |
finalizeTransactionMethod(boolean previousAutoCommit,
boolean fail)
This is called my any transaction method in its finally block. |
boolean |
getAutoCommit()
Retrieves the current autoCommit mode for the current DataSource. |
protected java.sql.Connection |
getConnection()
Gets a connection. |
protected java.sql.Connection |
getTransactionConnection()
This method should be called when a connection is required for transactions. |
void |
rollback()
Undoes all transactions made since the last commit or rollback. |
void |
setFeatures(FeatureCollection features)
Performs the setFeautres operation by removing all and then adding the full collection. |
Methods inherited from class org.geotools.data.AbstractDataSource |
abortLoading, addFeatures, getBounds, getFeatures, getFeatures, getFeatures, getFeatures, getFeatures, getMetaData, getSchema, makeDefaultQuery, modifyFeatures, modifyFeatures, removeFeatures, setAutoCommit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.sql.Connection transConn
Constructor Detail |
public JDBCDataSource(ConnectionPool pool)
Method Detail |
public void commit() throws DataSourceException
DataSourceException
- if there are any datasource errors.AbstractDataSource.setAutoCommit(boolean)
protected DataSourceMetaData createMetaData()
#MetaDataSupport
public void setFeatures(FeatureCollection features) throws DataSourceException
features
- the features to set for this table.
DataSourceException
- if there are problems removing or adding.
java.lang.UnsupportedOperationException
- If setFeatures is not supportedpublic void rollback() throws DataSourceException
DataSourceException
- if there are problems with the datasource.AbstractDataSource.setAutoCommit(boolean)
public boolean getAutoCommit() throws DataSourceException
DataSourceException
- if a datasource access error occurs.AbstractDataSource.setAutoCommit(boolean)
protected java.sql.Connection getConnection() throws DataSourceException
The connection returned by this method is suitable for a single use. Once a method has finish with the connection it should call the connections close method.
Methods wishing to use a connection for transactions or methods who use of the connection involves commits or rollbacks should use getTransactionConnection instead of this method.
DataSourceException
- If the connection is not an
OracleConnection.protected void finalizeTransactionMethod(boolean previousAutoCommit, boolean fail) throws DataSourceException
In all cases the autocommit status of the data source is set to previousAutoCommit and the closeTransactionConnection is called.
previousAutoCommit
- The status of autoCommit prior to the
beginning of a transaction method. This tells us whether we
should commit or wiat for the user to perform the commit.fail
- The fail status of the transaction. If true, the
transaction is rolled back.
DataSourceException
- If errors occur performing any of the
actions.protected java.sql.Connection getTransactionConnection() throws DataSourceException, java.sql.SQLException
DataSourceException
- IF an error occurs getting the connection.
java.sql.SQLException
- If there is something wrong with the connection.protected void closeTransactionConnection()
This method only closes the connection if it is set to auto commit. Otherwise the connection is kept open and held in the transactionConnection instance variable.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |