Data Store Management API

Feature Data Objects API

 
Data Store Management API
 
 
 

You can use this API to create a data store, destroy a data store, or list data stores. Three RDBMS providers (Oracle, MySQL, and SQL Server) and one file-based provider (SDF) support the data store commands. You can use the FdoICommandCapabilities object to verify this.

The procedure used for creating and destroying a data store in an RDBMS-based provider is slightly different than the procedure used for these operations in the SDF provider. The key difference is that the connection to the RDBMS-based provider is in the pending state, and the connection to the SDF provider is in the closed state.

Oracle, MySQL, and SQL Server Providers

To create or destroy a data store, do the following:

  1. Open a connection in the pending state to the provider as a user with administrative privileges.
  2. Use the connection object to create the FdoICreateDataStore or FdoIDestroyDataStore command object
  3. Use the command object to get the appropriate property dictionary.
  4. Use the property dictionary first to determine what properties must be given values and then to set those properties values.
  5. Call the command object's Execute() method.
  6. To verify the result of these operations, use the connection object to create an FdoIListDataStores command. Calling the Execute method on this object returns a data store property reader containing a list of the data stores in the data source. By default this list includes all of the data stores in the data source. Optionally, you can exclude the data stores not created using the FdoICreateDataStore command.

The difference between data stores created using the FdoICreateDataStore command and ones created by non-FDO means (for example, from the SQL command-line) is that the former contain a set of FDO-specific tables whose names are prefixed with F_ or f_, and which hold FDO metadata. You can view the list of tables created by the FdoICreateDataStore command using the following operations for each provider type:

  • Oracle: sql> select owner,table_name from dba_tables where owner = '<data store name>';
  • MySQL: mysql> show tables from <database name>;
  • SQL Server: In the Enterprise Manager application window, under Console Root , click Microsoft SQL Servers, click SQL Server Group, click SQL_Servername, click Databases , click database_name, click Tables.

Depending on the provider, most of the following values are displayed:

  • f_associationdefinition
  • f_attributedefinition
  • f_attributedependencies
  • f_classdefinition
  • f_classtype
  • f_dbopen
  • f_lockname
  • f_options
  • f_sad
  • f_schemainfo
  • f_schemaoptions
  • f_sequence
  • f_spatialcontext
  • f_spatialcontextgeom
  • f_spatialcontextgroup

SDF Provider

To create or destroy a data store, do the following:

  1. Use the FdoICreateDataStore command to create an SDF file and the FdoIDestroyDataStore command to delete it. These operations are performed with the connection in the closed state.
  2. Verify these operations by looking in the file system. The SDF provider does not support the FdoIListDataStores command.