Java Doc for JDBC1DataStore.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » jdbc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.data.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.data.jdbc.JDBC1DataStore

All known Subclasses:   org.geotools.data.jdbc.JDBC2DataStore,  org.geotools.data.hsql.HsqlDataStore,
JDBC1DataStore
abstract public class JDBC1DataStore implements DataStore(Code)
Abstract class for JDBC based DataStore implementations.

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:

  • sqlNameEscape - character (String) to surround names of SQL objects to support mixed-case and non-English names.


author:
   Amr Alam, Refractions Research
author:
   Sean Geoghegan, Defence Science and Technology Organisation
author:
   Chris Holmes, TOPP
author:
   Andrea Aime
version:
   $Id: JDBC1DataStore.java 29442 2008-02-25 09:36:19Z jgarnett $


Field Summary
final protected static  LoggerLOGGER
     The logger for the filter module.
final public static  MapTYPE_MAPPINGS
     Maps SQL types to Java classes.
protected  booleanallowWriteOnVolatileFIDs
     When true, writes are allowed also on tables with volatile FID mappers.
final protected  JDBCDataStoreConfigconfig
    
public  FeatureListenerManagerlistenerManager
    
protected  StringsqlNameEscape
    
protected  inttransactionIsolation
     The transaction isolation level to use in a transaction.
protected  FeatureTypeHandlertypeHandler
    

Constructor Summary
public  JDBC1DataStore(JDBCDataStoreConfig config)
     Construct a JDBCDataStore with ConnectionPool and associated configuration.

Method Summary
public  booleanallSameOrder(String[] requestedNames, FeatureType ft)
     returns true if the requested names list all the attributes in the correct order.
protected  booleanallowTable(String tablename)
     Provides a hook for sub classes to filter out specific tables in the data store that are not to be used as geospatial tables.
protected  String[]attributeNames(FeatureType featureType, Filter filter)
     Gets the list of attribute names required for both featureType and filter
Parameters:
  featureType - The FeatureType to get attribute names for.
Parameters:
  filter - The filter which needs attributes to filter.
protected  AttributeTypebuildAttributeType(ResultSet rs)
     Constructs an AttributeType from a row in a ResultSet.
protected  FIDMapperbuildFIDMapper(String typeName, FIDMapperFactory factory)
    
protected  FIDMapperFactorybuildFIDMapperFactory(JDBCDataStoreConfig config)
    
protected  FeatureTypebuildSchema(String typeName, FIDMapper mapper)
     Builds the schema for a table in the database.

This works by retrieving the column information for the table from the DatabaseMetaData object.

abstract protected  ConnectioncreateConnection()
    
protected  FeatureReadercreateFeatureReader(FeatureType schema, org.opengis.filter.Filter postFilter, QueryData queryData)
     Create a new FeatureReader based on attributeReaders.

The provided schema describes the attributes in the queryData ResultSet.

protected  JDBCFeatureWritercreateFeatureWriter(FeatureReader reader, QueryData queryData)
    
protected  LockingManagercreateLockingManager()
     Allows subclass to create LockingManager to support their needs.
public  voidcreateSchema(FeatureType featureType)
     Create a new featureType.
protected  StringdetermineFidColumnName(String typeName)
     Provides the default implementation of determining the FID column.

The default implementation of determining the FID column name is to use the primary key as the FID column.

protected  intdetermineSRID(String tableName, String geometryColumnName)
     Provides a hook for subclasses to determine the SRID of a geometry column.

This allows SRIDs to be determined in a Vendor specific way and to be cached by the default implementation.

protected  QueryDataexecuteQuery(FeatureTypeInfo featureTypeInfo, String tableName, String sqlQuery, Transaction transaction, boolean forWrite)
    
protected  QueryDataexecuteQuery(FeatureTypeInfo featureTypeInfo, String tableName, String sqlQuery, Transaction transaction, boolean forWrite, Hints hints)
     Executes the SQL Query.

This is private in the expectation that subclasses should not need to change this behaviour.

Jody with a question here - I have stopped this method from closing connection shared by a Transaction.

protected  AttributeIOgetAttributeIO(AttributeType type)
    
final protected  AttributeType[]getAttributeTypes(String typeName, String[] propertyNames)
     Gets the attribute types from from a given type.
Parameters:
  typeName - The name of the feature type to get the AttributeTypes for.
Parameters:
  propertyNames - The list of propertyNames to get AttributeTypes for.
protected  intgetConcurrency(boolean forWrite)
    
public  ConnectiongetConnection(Transaction transaction)
     Gets a connection for the provided transaction.
public  EnvelopegetEnvelope(String typeName)
     Retrieve approx bounds of all Features.
public  FIDMappergetFIDMapper(String tableName)
    
public  FIDMapperFactorygetFIDMapperFactory()
    
public  FeatureReadergetFeatureReader(FeatureType requestType, Filter filter, Transaction transaction)
     This is a public entry point to the DataStore.
public  FeatureReadergetFeatureReader(Query query, Transaction trans)
     The top level method for getting a FeatureReader.

Chris- I've gone with the Query object aswell.

public  FeatureSourcegetFeatureSource(String typeName)
     Default implementation based on getFeatureReader and getFeatureWriter.
protected  FeatureTypeHandlergetFeatureTypeHandler(JDBCDataStoreConfig config)
    
public  FeatureWritergetFeatureWriter(String typeName, Transaction transaction)
     Retrieve a FeatureWriter over entire dataset.
public  FeatureWritergetFeatureWriter(String typeName, org.opengis.filter.Filter filter, Transaction transaction)
     Acquire FeatureWriter for modification of contents specifed by filter.
public  FeatureWritergetFeatureWriterAppend(String typeName, Transaction transaction)
     Retrieve a FeatureWriter for creating new content.

Subclass may wish to implement an optimized featureWriter for this operation.

abstract protected  AttributeIOgetGeometryAttributeIO(AttributeType type, QueryData queryData)
     Hook to create the geometry attribute IO for a vendor specific data source.
protected  JDBCFeatureReadergetJDBCFeatureReader(QueryData queryData)
    
public  LockingManagergetLockingManager()
     Locking manager used for this DataStore.
public  URIgetNameSpace()
     Gets the namespace of the data store.
protected  intgetResultSetType(boolean forWrite)
    
public  FeatureTypegetSchema(String typeName)
    
public  SQLBuildergetSqlBuilder(String typeName)
     Hook for subclass to return a different sql builder.

Subclasses requiring a ClientTransactionAccessor should override and instantiate an SQLBuilder with one in the constructor.

public  StringgetSqlNameEscape()
     Gets the SQL name escape string.
public  SetgetSupportedHints()
    
public  intgetTransactionIsolation()
     Obtain the transaction isolation level for connections.
public  String[]getTypeNames()
    
public  FeatureSourcegetView(Query query)
    
protected  String[]propertyNames(Query query)
     Get propertyNames in a safe manner.
protected  booleanrequireAutoCommit()
     Return true if transaction is handled on client.
protected  voidsetAutoCommit(boolean forWrite, Connection conn)
     This method should be overridden to do nothing by DataStores where setting autoCommit causes funky behaviour (ie.
public  voidsetFIDMapper(String featureTypeName, FIDMapper fidMapper)
    
public  voidsetFIDMapperFactory(FIDMapperFactory fmFactory)
     Allows to override the default FIDMapperFactory.
protected  voidsetSqlNameEscape(String sqlNameEscape)
     Sets the SQL name escape string.
public  voidsetTransactionIsolation(int value)
     Sets the transaction isolation level for connections.
public  voidupdateSchema(String typeName, FeatureType featureType)
     Used to provide support for changing the DataStore Schema.

Specifically this is intended to address updating the metadata Coordinate System information.

If we can figure out the Catalog API for metadata we will not have to use such a heavy handed approach.

Subclasses are free to implement various levels of support:

  • None - table modification is not supported
  • CS change - ensure that the attribtue types match and only update metadata but not table structure.

Field Detail
LOGGER
final protected static Logger LOGGER(Code)
The logger for the filter module.



TYPE_MAPPINGS
final public static Map TYPE_MAPPINGS(Code)
Maps SQL types to Java classes. This might need to be fleshed out more later, Ive ignored complex types such as ARRAY, BLOB and CLOB. It is protected so subclasses can override it I guess.

These mappings were taken from http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html#997737




allowWriteOnVolatileFIDs
protected boolean allowWriteOnVolatileFIDs(Code)
When true, writes are allowed also on tables with volatile FID mappers. False by default
See Also:   FIDMapper.isVolatile



config
final protected JDBCDataStoreConfig config(Code)



listenerManager
public FeatureListenerManager listenerManager(Code)
Manages listener lists for FeatureSource implementations



sqlNameEscape
protected String sqlNameEscape(Code)
The character(s) to surround schema, table and column names an SQL query to support mixed-case and non-English names



transactionIsolation
protected int transactionIsolation(Code)
The transaction isolation level to use in a transaction. One of Connection.TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, or SERIALIZABLE. Connection.TRANSACTION_NONE may also be used to indicate "use default".



typeHandler
protected FeatureTypeHandler typeHandler(Code)




Constructor Detail
JDBC1DataStore
public JDBC1DataStore(JDBCDataStoreConfig config) throws IOException(Code)
Construct a JDBCDataStore with ConnectionPool and associated configuration.
Parameters:
  config -
throws:
  IOException -




Method Detail
allSameOrder
public boolean allSameOrder(String[] requestedNames, FeatureType ft)(Code)
returns true if the requested names list all the attributes in the correct order.
Parameters:
  requestedNames -
Parameters:
  ft -



allowTable
protected boolean allowTable(String tablename)(Code)
Provides a hook for sub classes to filter out specific tables in the data store that are not to be used as geospatial tables. The default implementation of this method is to allow all tables.
Parameters:
  tablename - A table name to check. True if the table should be exposed as a FeatureType, false if itshould be ignored.



attributeNames
protected String[] attributeNames(FeatureType featureType, Filter filter) throws IOException(Code)
Gets the list of attribute names required for both featureType and filter
Parameters:
  featureType - The FeatureType to get attribute names for.
Parameters:
  filter - The filter which needs attributes to filter. The list of attribute names required by a filter.
throws:
  IOException - If we can't get the schema.



buildAttributeType
protected AttributeType buildAttributeType(ResultSet rs) throws IOException(Code)
Constructs an AttributeType from a row in a ResultSet. The ResultSet contains the information retrieved by a call to getColumns() on the DatabaseMetaData object. This information can be used to construct an Attribute Type.

The default implementation constructs an AttributeType using the default JDBC type mappings defined in JDBCDataStore. These type mappings only handle native Java classes and SQL standard column types, so to handle Geometry columns, sub classes should override this to check if a column is a geometry column, if it is a geometry column the appropriate determination of the geometry type can be performed. Otherwise, overriding methods should call super.buildAttributeType.

Note: Overriding methods must never move the current row pointer in the result set.


Parameters:
  rs - The ResultSet containing the result of aDatabaseMetaData.getColumns call. The AttributeType built from the ResultSet or null if the columnshould be excluded from the schema.
throws:
  IOException - If an error occurs processing the ResultSet.



buildFIDMapper
protected FIDMapper buildFIDMapper(String typeName, FIDMapperFactory factory) throws IOException(Code)
Builds the appropriate FID mapper given a table name and a FID mapper factory
Parameters:
  typeName -
Parameters:
  factory -
throws:
  IOException -



buildFIDMapperFactory
protected FIDMapperFactory buildFIDMapperFactory(JDBCDataStoreConfig config)(Code)



buildSchema
protected FeatureType buildSchema(String typeName, FIDMapper mapper) throws IOException(Code)
Builds the schema for a table in the database.

This works by retrieving the column information for the table from the DatabaseMetaData object. It then iterates over the information for each column, calling buildAttributeType(ResultSet) to construct an AttributeType for each column. The list of attribute types is then turned into a FeatureType that defines the schema.

It is not intended that this method is overriden. It should provide the required functionality for most sub-classes. To add AttributeType construction for vendor specific SQL types, such as geometries, override the buildAttributeType(ResultSet) method.

This may become final later. In fact Ill make it private because I don't think It will need to be overriden.


Parameters:
  typeName - The name of the table to construct a feature type for.
Parameters:
  mapper - The name of the column holding the fid. The FeatureType for the table.
throws:
  IOException -
throws:
  DataSourceException - This can occur if there is an SQL error or an errorconstructing the FeatureType.
See Also:   JDBC1DataStore.buildAttributeType(ResultSet)



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



createFeatureReader
protected FeatureReader createFeatureReader(FeatureType schema, org.opengis.filter.Filter postFilter, QueryData queryData) throws IOException(Code)
Create a new FeatureReader based on attributeReaders.

The provided schema describes the attributes in the queryData ResultSet. This schema should cover the requirements of filter.

Retyping to the users requested Schema will not happen in this method.


Parameters:
  schema -
Parameters:
  postFilter - Filter for post processing, or null if notrequired.
Parameters:
  queryData - Holds a ResultSet for attribute Readers
throws:
  IOException -



createFeatureWriter
protected JDBCFeatureWriter createFeatureWriter(FeatureReader reader, QueryData queryData) throws IOException(Code)



createLockingManager
protected LockingManager createLockingManager()(Code)
Allows subclass to create LockingManager to support their needs.



createSchema
public void createSchema(FeatureType featureType) throws IOException(Code)
Create a new featureType.

Not currently supported - subclass may implement.


Parameters:
  featureType -
throws:
  IOException -
throws:
  UnsupportedOperationException - Creating new schemas is not supported.
See Also:   org.geotools.data.DataStore.createSchema(org.geotools.feature.FeatureType)



determineFidColumnName
protected String determineFidColumnName(String typeName) throws IOException(Code)
Provides the default implementation of determining the FID column.

The default implementation of determining the FID column name is to use the primary key as the FID column. If no primary key is present, null will be returned. Sub classes can override this behaviour to define primary keys for vendor specific cases.

There is an unresolved issue as to what to do when there are multiple primary keys. Maybe a restriction that table much have a single column primary key is appropriate.

This should not be called by subclasses to retreive the FID column name. Instead, subclasses should call getFeatureTypeInfo(String) to get the FeatureTypeInfo for a feature type and get the fidColumn name from the fidColumn name memeber.


Parameters:
  typeName - The name of the table to get a primary key for. The name of the primay key column or null if one does not exist.
throws:
  IOException - This will only occur if there is an error getting aconnection to the Database.



determineSRID
protected int determineSRID(String tableName, String geometryColumnName) throws IOException(Code)
Provides a hook for subclasses to determine the SRID of a geometry column.

This allows SRIDs to be determined in a Vendor specific way and to be cached by the default implementation. To retreive these srids, get the FeatureTypeInfo object for the table and call getSRID(geometryColumnName). This will allow storage of SRIDs for multiple geometry columns in each table.

If no SRID can be found, subclasses should return -1. The default implementation always returns -1.


Parameters:
  tableName - The name of the table to get the SRID for.
Parameters:
  geometryColumnName - The name of the geometry column within the table to get SRIDfor. The SRID for the geometry column in the table or -1.
throws:
  IOException -



executeQuery
protected QueryData executeQuery(FeatureTypeInfo featureTypeInfo, String tableName, String sqlQuery, Transaction transaction, boolean forWrite) throws IOException(Code)
See the full version with hints support
Parameters:
  featureTypeInfo -
Parameters:
  tableName -
Parameters:
  sqlQuery -
Parameters:
  transaction -
Parameters:
  forWrite -
throws:
  IOException -



executeQuery
protected QueryData executeQuery(FeatureTypeInfo featureTypeInfo, String tableName, String sqlQuery, Transaction transaction, boolean forWrite, Hints hints) throws IOException(Code)
Executes the SQL Query.

This is private in the expectation that subclasses should not need to change this behaviour.

Jody with a question here - I have stopped this method from closing connection shared by a Transaction. It sill seems like we are leaving connections open by using this method. I have also stopped QueryData from doing the same thing.

Answer from Sean: Resources for successful queries are closed when close is called on the AttributeReaders constructed with the QueryData. We can't close them here since they need to be open to read from the ResultSet.

Jody AttributeReader question: I looked at the code and Attribute Readers do not close with respect to Transactions (they need to as we can issue a Reader against a Transaction. I have changed the JDBCDataStore.close method to force us to keep track of these things.

SG: I've marked this as final since I don't think it shoudl be overriden, but Im not sure


Parameters:
  featureTypeInfo -
Parameters:
  tableName -
Parameters:
  sqlQuery - The SQL query to execute.
Parameters:
  transaction - The Transaction is included here for handling transactionconnections at a later stage. It is not currently used.
Parameters:
  forWrite -
Parameters:
  hints - the Query hints The QueryData object that contains the resources for the query.
throws:
  IOException -
throws:
  DataSourceException - If an error occurs performing the query.



getAttributeIO
protected AttributeIO getAttributeIO(AttributeType type)(Code)
Returns the basic AttributeIO that can read and write all of the simple data types
Parameters:
  type -



getAttributeTypes
final protected AttributeType[] getAttributeTypes(String typeName, String[] propertyNames) throws IOException, SchemaException(Code)
Gets the attribute types from from a given type.
Parameters:
  typeName - The name of the feature type to get the AttributeTypes for.
Parameters:
  propertyNames - The list of propertyNames to get AttributeTypes for. the array of attribute types from the schema which matchpropertyNames.
throws:
  IOException - If we can't get the schema.
throws:
  SchemaException - if query contains a propertyName that is not a part of thistype's schema.



getConcurrency
protected int getConcurrency(boolean forWrite)(Code)



getConnection
public Connection getConnection(Transaction transaction) throws IOException(Code)
Gets a connection for the provided transaction.
Parameters:
  transaction - A single use connection.
throws:
  IOException -
throws:
  DataSourceException - If the connection can not be obtained.



getEnvelope
public Envelope getEnvelope(String typeName)(Code)
Retrieve approx bounds of all Features.

This result is suitable for a quick map display, illustrating the data. This value is often stored as metadata in databases such as oraclespatial.

null as a generic implementation is not provided.



getFIDMapper
public FIDMapper getFIDMapper(String tableName) throws IOException(Code)



getFIDMapperFactory
public FIDMapperFactory getFIDMapperFactory()(Code)
Returns the FIDMapperFactory used for this data store



getFeatureReader
public FeatureReader getFeatureReader(FeatureType requestType, Filter filter, Transaction transaction) throws IOException(Code)
This is a public entry point to the DataStore.

We have given some though to changing this api to be based on query.

Currently the is is the only way to retype your features to different name spaces.

(non-Javadoc)



getFeatureReader
public FeatureReader getFeatureReader(Query query, Transaction trans) throws IOException(Code)
The top level method for getting a FeatureReader.

Chris- I've gone with the Query object aswell. It just seems to make more sense. This is pretty well split up across methods. The hooks for DB specific AttributeReaders are createResultSetReader and createGeometryReader.

JG- I have implemented getFeatureReader( FeatureType, Filter, Transasction) ontop of this method, it will Retype as required


Parameters:
  query - The Query to get a FeatureReader for.
Parameters:
  trans - The transaction this read operation is being performed in. A FeatureReader that contains features defined by the query.
throws:
  IOException - If an error occurs executing the query.
throws:
  DataSourceException -



getFeatureSource
public FeatureSource getFeatureSource(String typeName) throws IOException(Code)
Default implementation based on getFeatureReader and getFeatureWriter.

We should be able to optimize this to only get the RowSet once


See Also:   org.geotools.data.DataStore.getFeatureSource(java.lang.String)



getFeatureTypeHandler
protected FeatureTypeHandler getFeatureTypeHandler(JDBCDataStoreConfig config) throws IOException(Code)
DOCUMENT ME!
Parameters:
  config - DOCUMENT ME!
throws:
  IOException - DOCUMENT ME!



getFeatureWriter
public FeatureWriter getFeatureWriter(String typeName, Transaction transaction) throws IOException(Code)
Retrieve a FeatureWriter over entire dataset.

Quick notes: This FeatureWriter is often used to add new content, or perform summary calculations over the entire dataset.

Subclass may wish to implement an optimized featureWriter for these operations.

It should provide Feature for next() even when hasNext() is false.

Subclasses are responsible for checking with the lockingManger unless they are providing their own locking support.


Parameters:
  typeName -
Parameters:
  transaction -
throws:
  IOException -
See Also:   org.geotools.data.DataStore.getFeatureWriter(java.lang.Stringbooleanorg.geotools.data.Transaction)



getFeatureWriter
public FeatureWriter getFeatureWriter(String typeName, org.opengis.filter.Filter filter, Transaction transaction) throws IOException(Code)
Acquire FeatureWriter for modification of contents specifed by filter.

Quick notes: This FeatureWriter is often used to remove contents specified by the provided filter, or perform summary calculations.

Subclasses are responsible for checking with the lockingManager unless they are providing their own locking support.


Parameters:
  typeName -
Parameters:
  filter -
Parameters:
  transaction -
throws:
  IOException - If typeName could not be located
throws:
  NullPointerException - If the provided filter is null
throws:
  DataSourceException -



getFeatureWriterAppend
public FeatureWriter getFeatureWriterAppend(String typeName, Transaction transaction) throws IOException(Code)
Retrieve a FeatureWriter for creating new content.

Subclass may wish to implement an optimized featureWriter for this operation. One based on prepaired statemnts is a possibility, as we do not require a ResultSet.

To allow new content the FeatureWriter should provide Feature for next() even when hasNext() is false.

Subclasses are responsible for checking with the lockingManger unless they are providing their own locking support.


Parameters:
  typeName -
Parameters:
  transaction -
throws:
  IOException -
See Also:   org.geotools.data.DataStore.getFeatureWriter(java.lang.Stringbooleanorg.geotools.data.Transaction)



getGeometryAttributeIO
abstract protected AttributeIO getGeometryAttributeIO(AttributeType type, QueryData queryData) throws IOException(Code)
Hook to create the geometry attribute IO for a vendor specific data source.
Parameters:
  type - The AttributeType to read.
Parameters:
  queryData - The connection holder The AttributeIO that will read and write the geometry from theresults.
throws:
  IOException - DOCUMENT ME!



getJDBCFeatureReader
protected JDBCFeatureReader getJDBCFeatureReader(QueryData queryData) throws IOException(Code)



getLockingManager
public LockingManager getLockingManager()(Code)
Locking manager used for this DataStore.

By default AbstractDataStore makes use of InProcessLockingManager.


See Also:   org.geotools.data.DataStore.getLockingManager



getNameSpace
public URI getNameSpace()(Code)
Gets the namespace of the data store. TODO: change config over to use URI The namespace.



getResultSetType
protected int getResultSetType(boolean forWrite)(Code)



getSchema
public FeatureType getSchema(String typeName) throws IOException(Code)

See Also:   org.geotools.data.DataStore.getSchema(java.lang.String)



getSqlBuilder
public SQLBuilder getSqlBuilder(String typeName) throws IOException(Code)
Hook for subclass to return a different sql builder.

Subclasses requiring a ClientTransactionAccessor should override and instantiate an SQLBuilder with one in the constructor.
Parameters:
  typeName - The typename for the sql builder. A new sql builder.
throws:
  IOException - if anything goes wrong.




getSqlNameEscape
public String getSqlNameEscape()(Code)
Gets the SQL name escape string.

The value of this string is prefixed and appended to table schema names, table names and column names in an SQL statement to support mixed-case and non-English names.

the value of the SQL name escape string.



getSupportedHints
public Set getSupportedHints()(Code)



getTransactionIsolation
public int getTransactionIsolation()(Code)
Obtain the transaction isolation level for connections. Connection.TRANSACTION_* value
since:
   2.2.0
See Also:   setTransactionIsolation
See Also:    This web page



getTypeNames
public String[] getTypeNames() throws IOException(Code)

See Also:   org.geotools.data.DataStore.getFeatureTypes



getView
public FeatureSource getView(Query query) throws IOException, SchemaException(Code)



propertyNames
protected String[] propertyNames(Query query) throws IOException(Code)
Get propertyNames in a safe manner.

Method will figure out names from the schema for query.getTypeName(), if query getPropertyNames() is null, or query.retrieveAllProperties is true.


Parameters:
  query -
throws:
  IOException -



requireAutoCommit
protected boolean requireAutoCommit()(Code)
Return true if transaction is handled on client. Usually this will not have to be overridden. true if transaction is handled on client. Usually this will not have to be overridden.



setAutoCommit
protected void setAutoCommit(boolean forWrite, Connection conn) throws SQLException(Code)
This method should be overridden to do nothing by DataStores where setting autoCommit causes funky behaviour (ie. anytime autoCommit is changed, every thing up to that point is committed...this isn't good at this stage)
Parameters:
  forWrite -
Parameters:
  conn -
throws:
  SQLException -



setFIDMapper
public void setFIDMapper(String featureTypeName, FIDMapper fidMapper)(Code)
Sets the FIDMapper for a specific type name
Parameters:
  featureTypeName -
Parameters:
  fidMapper -



setFIDMapperFactory
public void setFIDMapperFactory(FIDMapperFactory fmFactory) throws UnsupportedOperationException(Code)
Allows to override the default FIDMapperFactory.

Warning: the ovveride may not be supported by all data stores, in this case an exception will be thrown


Parameters:
  fmFactory -
throws:
  UnsupportedOperationException - -if the datastore does not allow the factory override



setSqlNameEscape
protected void setSqlNameEscape(String sqlNameEscape)(Code)
Sets the SQL name escape string.

The value of this string is prefixed and appended to table schema names, table names and column names in an SQL statement to support mixed-case and non-English names.

This value is typically only set once when the DataStore implementation class is constructed.


Parameters:
  sqlNameEscape - the name escape character



setTransactionIsolation
public void setTransactionIsolation(int value)(Code)
Sets the transaction isolation level for connections.
Parameters:
  value - Connection.TRANSACTION_READ_UNCOMMITTED,Connection.TRANSACTION_READ_COMMITTED,Connection.TRANSACTION_REPEATABLE_READ,Connection.SERIALIZABLE, or Connection.TRANSACTION_NONE(for use default/do not set)
since:
   2.2.0
See Also:    This web page



updateSchema
public void updateSchema(String typeName, FeatureType featureType) throws IOException(Code)
Used to provide support for changing the DataStore Schema.

Specifically this is intended to address updating the metadata Coordinate System information.

If we can figure out the Catalog API for metadata we will not have to use such a heavy handed approach.

Subclasses are free to implement various levels of support:

  • None - table modification is not supported
  • CS change - ensure that the attribtue types match and only update metadata but not table structure.
  • Allow table change opperations

See Also:   org.geotools.data.DataStore.updateSchema(java.lang.Stringorg.geotools.feature.FeatureType)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.