org.geotools.data.jdbc
Class JDBC2DataStore

Object
  extended by JDBC1DataStore
      extended by JDBC2DataStore
All Implemented Interfaces:
DataAccess<SimpleFeatureType,SimpleFeature>, DataStore
Direct Known Subclasses:
JDBCDataStore

public abstract class JDBC2DataStore
extends JDBC1DataStore

This JDBCDataStore is able to take advantage of additonal functionality provided by JDBC2 level drivers - for example ConnectionPools.

This class provides a default implementation of a JDBC data store. Support for vendor specific JDBC data stores can be easily added to Geotools by subclassing this class and overriding the hooks provided.

At a minimum subclasses should implement the following methods:

Additionally subclasses can optionally override the following:

Additionally subclasses may want to set the value of:

Author:
Amr Alam, Refractions Research, Jody Garnett, Refractions Research
Module:

Field Summary
protected  DataSource dataSource
           
 
Fields inherited from class JDBC1DataStore
allowWriteOnVolatileFIDs, config, listenerManager, LOGGER, sqlNameEscape, transactionIsolation, TYPE_MAPPINGS, typeHandler
 
Constructor Summary
JDBC2DataStore(DataSource dataSource, JDBCDataStoreConfig config)
          Construct a JDBCDataStore with ConnectionPool and associated configuration.
 
Method Summary
protected  Connection createConnection()
          Create a connection for your JDBC1 database
 void dispose()
          Disposes of this data store and releases any resource that it is using.
protected  void finalize()
           
 
Methods inherited from class JDBC1DataStore
allowTable, allSameOrder, attributeNames, buildAttributeType, buildFIDMapper, buildFIDMapperFactory, buildSchema, createFeatureReader, createFeatureWriter, createLockingManager, createSchema, determineFidColumnName, determineSRID, executeQuery, executeQuery, getAttributeIO, getAttributeTypes, getConcurrency, getConnection, getDatabaseSchemaName, getEnvelope, getFeatureReader, getFeatureReader, getFeatureSource, getFeatureSource, getFeatureTypeHandler, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getFIDMapper, getFIDMapperFactory, getGeometryAttributeIO, getInfo, getJDBCFeatureReader, getLockingManager, getNames, getNameSpace, getResultSetType, getSchema, getSchema, getSqlBuilder, getSqlNameEscape, getSupportedHints, getTransactionIsolation, getTypeNames, getView, propertyNames, requireAutoCommit, setAutoCommit, setFIDMapper, setFIDMapperFactory, setSqlNameEscape, setTransactionIsolation, updateSchema, updateSchema
 
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSource

protected DataSource dataSource
Constructor Detail

JDBC2DataStore

public JDBC2DataStore(DataSource dataSource,
                      JDBCDataStoreConfig config)
               throws IOException
Construct a JDBCDataStore with ConnectionPool and associated configuration.

Parameters:
connectionPool -
config -
Throws:
IOException
Method Detail

createConnection

protected Connection createConnection()
                               throws SQLException
Create a connection for your JDBC1 database

Specified by:
createConnection in class JDBC1DataStore
Throws:
SQLException

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

dispose

public void dispose()
Description copied from interface: DataAccess
Disposes of this data store and releases any resource that it is using.

A DataStore cannot be used after dispose has been called, neither can any data access object it helped create, such as FeatureReader, FeatureSource or FeatureCollection.

This operation can be called more than once without side effects.

There is no thread safety assurance associated with this method. For example, client code will have to make sure this method is not called while retrieving/saving data from/to the storage, or be prepared for the consequences.



Copyright © 1996-2009 Geotools. All Rights Reserved.