| 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 |
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 AttributeType | buildAttributeType(ResultSet rs) Constructs an AttributeType from a row in a ResultSet. | protected JDBCFeatureWriter | createFeatureWriter(FeatureReader reader, QueryData queryData) | public FeatureWriter | getFeatureWriter(String typeName) Utility method for getting a FeatureWriter for modifying existing features,
using no feature filtering and auto-committing. | public FeatureWriter | getFeatureWriterAppend(String typeName) Utility method for getting a FeatureWriter for adding new features, using
auto-committing. | protected AttributeIO | getGeometryAttributeIO(AttributeType type, QueryData queryData) | public static MySQLDataStore | getInstance(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 MySQLDataStore | getInstance(String host, int port, String schema, String username, String password) Utility method for creating a MySQLDataStore from database connection parameters. | public SQLBuilder | getSqlBuilder(String typeName) | public Set | getSupportedHints() | public boolean | isWKBEnabled() | protected void | setAutoCommit(boolean forWrite, Connection conn) | public void | setWKBEnabled(boolean enabled) |
wkbEnabled | protected boolean wkbEnabled(Code) | | When true wkb encoding will be used to transfer geometries over the wire
|
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 |
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. |
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 |
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 |
getSupportedHints | public Set getSupportedHints()(Code) | | |
isWKBEnabled | public boolean isWKBEnabled()(Code) | | Returns true if the WKB format is used to transfer geometries, false
otherwise
|
setWKBEnabled | public void setWKBEnabled(boolean enabled)(Code) | | If turned on, WKB will be used to transfer geometry data instead of WKT
Parameters: enabled - |
|
|