Class SQLStore

java.lang.Object
org.apache.sis.storage.DataStore
org.apache.sis.storage.sql.SQLStore
All Implemented Interfaces:
AutoCloseable, Aggregate, Resource, Localized

public class SQLStore extends DataStore implements Aggregate
A data store capable to read and create features from a spatial database. SQLStore requires a DataSource to be specified (indirectly) at construction time. The DataSource should provide pooled connections, because SQLStore will frequently opens and closes them.
Since:
1.0
Version:
1.3
  • Field Details

    • NAME_GETTERS

      private static final String[] NAME_GETTERS
      Names of possible public getter methods for data source title, in preference order.
    • source

      private final DataSource source
      The data source to use for obtaining connections to the database.
    • geomLibrary

      private final GeometryLibrary geomLibrary
      The library to use for creating geometric objects, or null for system default.
    • model

      private Database<?> model
      The result of inspecting database schema for deriving FeatureTypes. Created when first needed. May be discarded and recreated if the store needs a refresh.
    • tableNames

      private final org.opengis.util.GenericName[] tableNames
      Fully qualified names (including catalog and schema) of the tables to include in this store. The names shall be qualified names of 1, 2 or 3 components. The name components can be <catalog>.<schema pattern>.<table pattern> where:
      • <catalog>, if present, is the name of a catalog as stored in the database.
      • <schema pattern>, if present, is the pattern of a schema. The pattern can use '_' and '%' wildcards characters.
      • <table pattern> (mandatory) is the pattern of a table. The pattern can use '_' and '%' wildcards characters.
      Only the main tables need to be specified; dependencies will be followed automatically.
    • queries

      private final ResourceDefinition[] queries
      Queries to expose as resources, or an empty array if none.
    • metadata

      private org.opengis.metadata.Metadata metadata
      The metadata, created when first requested.
    • customizer

      private final SchemaModifier customizer
      The user-specified method for customizing the schema inferred by table analysis. This is null if there is none.
  • Constructor Details

    • SQLStore

      public SQLStore(SQLStoreProvider provider, StorageConnector connector, ResourceDefinition... resources) throws DataStoreException
      Creates a new SQLStore for the given data source and tables, views or queries. The given connector shall contain a DataSource instance. Tables or views to include in the store are specified by the resources argument. Only the main tables need to be specified; dependencies will be followed automatically.
      Parameters:
      provider - the factory that created this DataStore instance, or null if unspecified.
      connector - information about the storage (JDBC data source, etc).
      resources - tables, views or queries to include in this store.
      Throws:
      DataStoreException - if an error occurred while creating the data store for the given storage.
      Since:
      1.1
  • Method Details