Methods for accessing data – Pitney Bowes MapXtreme User Manual

Page 171

Advertising
background image

Chapter 8: Working with Data

Table Metadata (TableInfo)

MapXtreme v7.1

178

Developer Guide

Methods for Accessing Data

MapXtreme provides several ways to bring data into the Catalog:

Direct access to data sources

Access via an ADO.NET data provider (TableInfoAdoNet)

XML/GML from third-party web services

The best method to access data is to open it directly using one of the TableInfo classes that are
specific to where your data resides.

Use the second method (TableInfoAdoNet) to access data that is not internally supported but has an
ADO.NET provider.

A third method allows developers to integrate data to the Catalog who may interact with HTTP
services that return XML or GML.

Direct Access to Data Sources

MapXtreme provides native support for accessing data stored in file-based table formats and
RDBMS servers, such as SQL Server and Oracle. In the case of file-based access, provide the path
and filename in the appropriate TableInfo instance (TableInfoNative, TableInfodBase,
TableInfoMSAssess, TableInfoAscii).

For direct access to data stored in RDBMS serves, use the TableInfoServer class to define the
connection string and an SQL statement to execute on the remote table. Internally, MapXtreme uses
ODBC or OCI to access the remote database.

TableInfoServer will open a connection to the server, query the table's metadata, and create the
appropriate table definition with any spatial characteristics that are defined on the remote server.
This tends to be the best performing method with remote data. Internally, MapXtreme can access
only the data necessary to perform the current operation. During a map draw, MapXtreme will
construct a query that returns only the geometry column, and not the data columns. This minimizes
the network traffic. If caching is on, then this is only an issue for the first access, since all subsequent
requests will come from the cache. See

Chapter 11: Accessing Data from a DBMS

.

Access via an ADO.NET DataProvider

The second data access method is to use an ADO.NET data provider. This requires the definition of
ADO.NET classes for data retrieval. Only non-mappable tables may be supplied as an AdoNet table.
Non-mappable tables are those that do not contain geometry information about the data. Tables
retrieved from an ADO.NET provider, however, can be made mappable by applying a
SpatialSchema to the table definition. In this method, the MapXtreme DataAccess engine calls the
ADO.NET data provider whenever data is requested by a user. This tends to be a slower method of
accessing data. However, when used in conjunction with caching, it performs well. See

Using an

ADO.NET Data Provider

.

Advertising