Perforce JViews Maps Sample: Connecting to IBM DB2 and Informix Databases
Description
This sample shows how to use Perforce JViews Maps with IBM DB2 and Informix databases
How to Use the Sample
-
To be able to import DB2 or Informix Spatial layers, you must have access to a database server with the Spatial Extender (DB2)
or Spatial Datablade (Informix) installed and configured.
You must also have an account with read permission on the tables you want to access.
For more information, contact your database administrator who can help you define the correct connection parameters.
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
ibmdb.jar
,
that allows you to execute the sample with a double click from a
file browser. Note that if you are using Internet Explorer, you can
open the installation directory
and execute the JAR file from the browser. This
technique may not work in other Web browsers.
Alternatively, you
can run the sample application from the command line.
First check that the Ant utility is properly configured. If not, see the
instructions on how to configure Ant for Perforce JViews.
Then, go to the installation directory
of the sample and type:
ant run
Topics Covered
- Loading from an IBM DB2 table
- Loading from an IBM Informix table
Detailed Description
This sample shows how to use Perforce JViews Maps with IBM DB2 and Informix databases.
This sample provides source code that shows you how to:
- Import vector data from a DB2 database into Perforce JViews through a selection dialog.
- Import vector data from an Informix database into Perforce JViews through a selection dialog.
- Import vector data from a DB2 database into Perforce JViews using an application-coded database connection and table specification.
: Loads a spatial layer using an DB2 data source (
IlvDB2Datasource
).
: Loads a spatial layer using an Informix data source (
IlvInformixDatasource
).
This sample uses the packages
ilog.views.maps.datasource.ibm
,
ilog.views.maps.datasource.ibm.db2
, and
ilog.views.maps.datasource.ibm.informix
.
About IBM Spatial Database Support
The IBM relational database products DB2 and Informix both have features that provide the ability to create a database table with a geospatial type such as point, line, or polygon. The values in a spatial column can be created by importing from a source, such as the ESRI shapefile de-facto standard, or by populating the database with an SQL constructor function that uses numeric values, geometric shapes, well-known text, or well-known binary representations.A set of spatial SQL functions and predicates that implement the Open Geospatial Consortium (OGC) specification allow you to create SQL queries including operations like "distance", "within", and "intersects between" spatial values.
For more information about these capabilities, refer to the DB2 or Informix online documentation and the IBM Spatial Web site .
Installation Directory
The Connecting to IBM DB2 and Informix Databases sample is installed here.
Classes Involved
- ilog.views.maps.datasource.ibm.IlvDB2ConnectionPanel
- ilog.views.maps.datasource.ibm.db2.IlvDB2DataSource
- ilog.views.maps.beans.IlvMapLayer