Java Doc for DB2DataStore.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » db2 » 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.db2 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.geotools.data.jdbc.JDBCDataStore
   org.geotools.data.db2.DB2DataStore

DB2DataStore
public class DB2DataStore extends JDBCDataStore (Code)
DB2 DataStore implementation.

Instances of this class should only be obtained via DB2DataStoreFactory.createDataStore or DataStoreFinder.getDataStore.


author:
   David Adler - IBM Corporation



Constructor Summary
public  DB2DataStore(DataSource dataSource, JDBCDataStoreConfig config, String dbURL)
     The only supported constructor for a DB2DataStore.

Method Summary
protected  AttributeTypebuildAttributeType(ResultSet rs)
     Handles DB2-specific geometry types.
protected  FIDMapperFactorybuildFIDMapperFactory(JDBCDataStoreConfig config)
     Creates a DB2-specific FIDMapperFactory.
Parameters:
  config - not used.
protected  JDBCFeatureWritercreateFeatureWriter(FeatureReader featureReader, QueryData queryData)
     Overrides the method in JDBCDataStore so that a DB2FeatureWriter is created.
protected  intdetermineSRID(String tableName, String geometryColumnName)
     Get the SRID associated with a geometry column.

The value returned is the EPSG coordinate system identifier, not the DB2 srs_id.


Parameters:
  tableName - The name of the table to get the SRID for.
Parameters:
  geometryColumnName - The name of the geometry column within thetable to get SRID for.
protected  QueryDataexecuteQuery(FeatureTypeInfo featureTypeInfo, String tableName, String sqlQuery, Transaction transaction, boolean forWrite)
     Overrides the method in JDBCDataStore because it includes PostGIS-specific handling to setAutoCommit(false) which causes problems for DB2 because the transaction is still uncommitted when the connection is closed.
Parameters:
  featureTypeInfo -
Parameters:
  tableName -
Parameters:
  sqlQuery - The SQL query to execute.
Parameters:
  transaction - The Transaction is included here for handlingtransaction connections at a later stage.
 StringgetDbURL()
     Gets the database URL.
public  FeatureReadergetFeatureReader(FeatureType requestType, Filter filter, Transaction transaction)
     This is a public entry point to the DataStore.
public  FeatureSourcegetFeatureSource(String typeName)
     Gets a DB2-specific feature source.
protected  FeatureTypeHandlergetFeatureTypeHandler(JDBCDataStoreConfig config)
     Create a DB2-specific FeatureTypeHandler.
Parameters:
  config - a JDBCDataStoreConfig.
protected  AttributeIOgetGeometryAttributeIO(AttributeType type, QueryData queryData)
     Gets the handler to convert a geometry database value to a JTS geometry.
Parameters:
  type - not used.
Parameters:
  queryData - not used.
 DB2SpatialCataloggetSpatialCatalog()
     Gets the instance of the DB2SpatialCatalog associated with this data store.
public  SQLBuildergetSqlBuilder(String typeName)
     Gets the DB2-specific SQL builder object.
Parameters:
  typeName - Name of the type to build the SQL for.
public  StringgetTableSchema()
     Gets the table schema associated with this data store.
public  String[]getTypeNames()
     Gets the names of tables (types) that contain a spatial column.
public  voidrefreshCatalog()
     Reloads the spatial catalog from the database.


Constructor Detail
DB2DataStore
public DB2DataStore(DataSource dataSource, JDBCDataStoreConfig config, String dbURL) throws IOException(Code)
The only supported constructor for a DB2DataStore. This constructor is mainly intended to be called from DB2DataStoreFactory.
Parameters:
  connectionPool - the initialized DB2 connection pool
Parameters:
  config - the JDBCDataStoreConfiguration
Parameters:
  dbURL - the database URL of the formjdbc:db2://hostname:hostport/dbname
throws:
  IOException -




Method Detail
buildAttributeType
protected AttributeType buildAttributeType(ResultSet rs) throws IOException(Code)
Handles DB2-specific geometry types. If it isn't one, just let the parent method handle it.
Parameters:
  rs - The ResultSet containing the result of aDatabaseMetaData.getColumns call. The AttributeType built from the ResultSet.
throws:
  IOException - If an error occurs processing the ResultSet.



buildFIDMapperFactory
protected FIDMapperFactory buildFIDMapperFactory(JDBCDataStoreConfig config)(Code)
Creates a DB2-specific FIDMapperFactory.
Parameters:
  config - not used. a DB2FIDMapperFactory



createFeatureWriter
protected JDBCFeatureWriter createFeatureWriter(FeatureReader featureReader, QueryData queryData) throws IOException(Code)
Overrides the method in JDBCDataStore so that a DB2FeatureWriter is created.
Parameters:
  featureReader -
Parameters:
  queryData - The DB2FeatureWriter
throws:
  IOException -
See Also:   org.geotools.data.jdbc.JDBCDataStore.createFeatureWriter(org.geotools.data.FeatureReaderorg.geotools.data.jdbc.QueryData)



determineSRID
protected int determineSRID(String tableName, String geometryColumnName) throws IOException(Code)
Get the SRID associated with a geometry column.

The value returned is the EPSG coordinate system identifier, not the DB2 srs_id.


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



executeQuery
protected QueryData executeQuery(FeatureTypeInfo featureTypeInfo, String tableName, String sqlQuery, Transaction transaction, boolean forWrite) throws IOException(Code)
Overrides the method in JDBCDataStore because it includes PostGIS-specific handling to setAutoCommit(false) which causes problems for DB2 because the transaction is still uncommitted when the connection is closed.
Parameters:
  featureTypeInfo -
Parameters:
  tableName -
Parameters:
  sqlQuery - The SQL query to execute.
Parameters:
  transaction - The Transaction is included here for handlingtransaction connections at a later stage. It is not currentlyused.
Parameters:
  forWrite - The QueryData object that contains the resources for the query.
throws:
  IOException -
throws:
  DataSourceException - If an error occurs performing the query.



getDbURL
String getDbURL()(Code)
Gets the database URL. the database URL.



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)
See Also:   org.geotools.data.DataStore.getFeatureReader(org.geotools.feature.FeatureTypeorg.geotools.filter.Filterorg.geotools.data.Transaction)



getFeatureSource
public FeatureSource getFeatureSource(String typeName) throws IOException(Code)
Gets a DB2-specific feature source.
Parameters:
  typeName - a DB2Feature Source, Store or Locking
throws:
  IOException - if the feature source could not be created.
See Also:   org.geotools.data.DataStore.getFeatureSource(java.lang.String)



getFeatureTypeHandler
protected FeatureTypeHandler getFeatureTypeHandler(JDBCDataStoreConfig config) throws IOException(Code)
Create a DB2-specific FeatureTypeHandler.
Parameters:
  config - a JDBCDataStoreConfig. a DB2FeatureTypeHandler.
throws:
  IOException - if the feature type handler could not be created.



getGeometryAttributeIO
protected AttributeIO getGeometryAttributeIO(AttributeType type, QueryData queryData)(Code)
Gets the handler to convert a geometry database value to a JTS geometry.
Parameters:
  type - not used.
Parameters:
  queryData - not used. AttributIO



getSpatialCatalog
DB2SpatialCatalog getSpatialCatalog()(Code)
Gets the instance of the DB2SpatialCatalog associated with this data store. a DB2SpatialCatalog



getSqlBuilder
public SQLBuilder getSqlBuilder(String typeName) throws IOException(Code)
Gets the DB2-specific SQL builder object.
Parameters:
  typeName - Name of the type to build the SQL for. DB2SQLBuilder
throws:
  IOException -



getTableSchema
public String getTableSchema()(Code)
Gets the table schema associated with this data store.

At some point this may change if multiple schemas are supported by a data store.

the schema name that will prefix table names.



getTypeNames
public String[] getTypeNames() throws IOException(Code)
Gets the names of tables (types) that contain a spatial column. Note that there is still an issue concerning the ambiguity of spatial tables that have the same table name but different table schema names. Array of type names as Strings.
throws:
  IOException - if the spatial catalog can not be accessed.



refreshCatalog
public void refreshCatalog() throws IOException(Code)
Reloads the spatial catalog from the database.

This is useful in case anything changed after the datastore was initialized.
throws:
  IOException -
throws:
  SQLException -




Fields inherited from org.geotools.data.jdbc.JDBCDataStore
protected DataSource dataSource(Code)(Java Doc)
protected String databaseSchema(Code)(Java Doc)

Methods inherited from org.geotools.data.jdbc.JDBCDataStore
final public Connection connection()(Code)(Java Doc)
protected ContentState createContentState(ContentEntry entry)(Code)(Java Doc)
protected ContentFeatureSource createFeatureSource(ContentEntry entry) throws IOException(Code)(Java Doc)
protected SQLBuilder createSQLBuilder()(Code)(Java Doc)
public void createSchema(FeatureType featureType) throws IOException(Code)(Java Doc)
protected JDBCTypeBuilder createTypeBuilder()(Code)(Java Doc)
protected JDBCTypeBuilder createTypeBuilder(SimpleTypeFactory typeFactory)(Code)(Java Doc)
protected List createTypeNames() throws IOException(Code)(Java Doc)
public DataSource getDataSource()(Code)(Java Doc)
public String getDatabaseSchema()(Code)(Java Doc)
public Logger getLogger()(Code)(Java Doc)
public PrimaryKey getPrimaryKey(ContentEntry entry) throws IOException(Code)(Java Doc)
public PrimaryKey getPrimaryKey(FeatureType featureType) throws IOException(Code)(Java Doc)
public void setDataSource(DataSource dataSource)(Code)(Java Doc)
public void setDatabaseSchema(String databaseSchema)(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.