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


org.geotools.data.jdbc.JDBCDataStore
   org.geotools.data.mysql.MySQLDataStore

MySQLDataStore
public class MySQLDataStore extends JDBCDataStore (Code)
An implementation of the GeoTools Data Store API for the MySQL database platform. The plan is to support traditional MySQL datatypes, as well as the new geometric datatypes provided with MySQL 4.1 and higher.

TODO: MySQLDataStore is not yet tested for MySQL 4.1's geometric datatypes.

Please see org.geotools.data.jdbc.JDBCDataStore class JDBCDataStore and org.geotools.data.DataStore interface DataStore for DataStore usage details.
author:
   Gary Sheppard garysheppard@psu.edu
author:
   Andrea Aime aaime@users.sourceforge.net
author:
   Debasish Sahu debasish.sahu@rmsi.com


Field Summary
protected  booleanwkbEnabled
    

Constructor Summary
public  MySQLDataStore(DataSource dataSource)
     Basic constructor for MySQLDataStore.
public  MySQLDataStore(DataSource dataSource, String databaseSchemaName)
     Constructor for MySQLDataStore where the database schema name is provided.
Parameters:
  dataSource - A source of connections for this datastore
Parameters:
  databaseSchemaName - the database schema.
public  MySQLDataStore(DataSource dataSource, String databaseSchemaName, String namespace)
     Constructor for MySQLDataStore where the database schema name is provided.
Parameters:
  dataSource - A source of connections for this datastore
Parameters:
  databaseSchemaName - the database schema.

Method Summary
protected  AttributeTypebuildAttributeType(ResultSet rs)
     Constructs an AttributeType from a row in a ResultSet.
protected  JDBCFeatureWritercreateFeatureWriter(FeatureReader reader, QueryData queryData)
    
public  FeatureWritergetFeatureWriter(String typeName)
     Utility method for getting a FeatureWriter for modifying existing features, using no feature filtering and auto-committing.
public  FeatureWritergetFeatureWriterAppend(String typeName)
     Utility method for getting a FeatureWriter for adding new features, using auto-committing.
protected  AttributeIOgetGeometryAttributeIO(AttributeType type, QueryData queryData)
    
public static  MySQLDataStoregetInstance(String host, String schema, String username, String password)
     A utility method for creating a MySQLDataStore from database connection parameters, using the default port (3306) for MySQL.
public static  MySQLDataStoregetInstance(String host, int port, String schema, String username, String password)
     Utility method for creating a MySQLDataStore from database connection parameters.
public  SQLBuildergetSqlBuilder(String typeName)
    
public  SetgetSupportedHints()
    
public  booleanisWKBEnabled()
    
protected  voidsetAutoCommit(boolean forWrite, Connection conn)
    
public  voidsetWKBEnabled(boolean enabled)
    

Field Detail
wkbEnabled
protected boolean wkbEnabled(Code)
When true wkb encoding will be used to transfer geometries over the wire




Constructor Detail
MySQLDataStore
public MySQLDataStore(DataSource dataSource) throws IOException(Code)
Basic constructor for MySQLDataStore. be done similar to the following:

Parameters:
  dataSource - A source of connections for this datastore
throws:
  IOException - if the database cannot be properly accessed
See Also:   javax.sql.DataSource
See Also:   org.geotools.data.mysql.MySQLConnectionFactory



MySQLDataStore
public MySQLDataStore(DataSource dataSource, String databaseSchemaName) throws IOException(Code)
Constructor for MySQLDataStore where the database schema name is provided.
Parameters:
  dataSource - A source of connections for this datastore
Parameters:
  databaseSchemaName - the database schema. Can be null. See the comments for the parameter schemaPattern in java.sql.DatabaseMetaData.getTables(StringStringStringString[]) DatabaseMetaData.getTables, because databaseSchemaName behaves in the same way.
throws:
  IOException - if the database cannot be properly accessed



MySQLDataStore
public MySQLDataStore(DataSource dataSource, String databaseSchemaName, String namespace) throws IOException(Code)
Constructor for MySQLDataStore where the database schema name is provided.
Parameters:
  dataSource - A source of connections for this datastore
Parameters:
  databaseSchemaName - the database schema. Can be null. See the comments for the parameter schemaPattern in java.sql.DatabaseMetaData.getTables(StringStringStringString[]) DatabaseMetaData.getTables, because databaseSchemaName behaves in the same way.
Parameters:
  namespace - the namespace for this data store. Can be null, in which case the namespace will simply be the schema name.
throws:
  IOException - if the database cannot be properly accessed




Method Detail
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.

In addition to standard SQL types, this method identifies MySQL 4.1's geometric datatypes and creates attribute types accordingly. This happens when the datatype, identified by column 5 of the ResultSet parameter, is equal to java.sql.Types.OTHER. If a Types.OTHER ends up not being geometric, this method simply calls the parent class's buildAttributeType method to do something with it.

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.
throws:
  SQLException - If an error occurs processing the ResultSet.
throws:
  DataSourceException - Provided for overriding classes to wrapexceptions caused by other operations they may perform todetermine additional types. This will only be thrown by thedefault implementation if a type is present that is not presentin the TYPE_MAPPINGS.



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



getFeatureWriter
public FeatureWriter getFeatureWriter(String typeName) throws IOException(Code)
Utility method for getting a FeatureWriter for modifying existing features, using no feature filtering and auto-committing. Not used for adding new features.
Parameters:
  typeName - the feature type name (the table name) a FeatureWriter for modifying existing features
throws:
  IOException - if the database cannot be properly accessed



getFeatureWriterAppend
public FeatureWriter getFeatureWriterAppend(String typeName) throws IOException(Code)
Utility method for getting a FeatureWriter for adding new features, using auto-committing. Not used for modifying existing features.
Parameters:
  typeName - the feature type name (the table name) a FeatureWriter for adding new features
throws:
  IOException - if the database cannot be properly accessed



getGeometryAttributeIO
protected AttributeIO getGeometryAttributeIO(AttributeType type, QueryData queryData)(Code)

See Also:   org.geotools.data.jdbc.JDBCDataStore.getGeometryAttributeIO(org.geotools.feature.AttributeType)



getInstance
public static MySQLDataStore getInstance(String host, String schema, String username, String password) throws IOException, SQLException(Code)
A utility method for creating a MySQLDataStore from database connection parameters, using the default port (3306) for MySQL.
Parameters:
  host - the host name or IP address of the database server
Parameters:
  schema - the name of the database instance
Parameters:
  username - the database username
Parameters:
  password - the password corresponding to username a MySQLDataStore for the specified parameters



getInstance
public static MySQLDataStore getInstance(String host, int port, String schema, String username, String password) throws IOException, SQLException(Code)
Utility method for creating a MySQLDataStore from database connection parameters.
Parameters:
  host - the host name or IP address of the database server
Parameters:
  port - the port number of the database
Parameters:
  schema - the name of the database instance
Parameters:
  username - the database username
Parameters:
  password - the password corresponding to username
throws:
  IOException - if the MySQLDataStore cannot be created because the database cannot be properly accessed
throws:
  SQLException - if a MySQL connection pool cannot be established



getSqlBuilder
public SQLBuilder getSqlBuilder(String typeName) throws IOException(Code)

See Also:   org.geotools.data.jdbc.JDBCDataStore.getSqlBuilder(java.lang.String)



getSupportedHints
public Set getSupportedHints()(Code)



isWKBEnabled
public boolean isWKBEnabled()(Code)
Returns true if the WKB format is used to transfer geometries, false otherwise



setAutoCommit
protected void setAutoCommit(boolean forWrite, Connection conn) throws SQLException(Code)



setWKBEnabled
public void setWKBEnabled(boolean enabled)(Code)
If turned on, WKB will be used to transfer geometry data instead of WKT
Parameters:
  enabled -



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.