skip to main content
Setting up your development environment for an IP : Setting up the IP source and schema
 

Setting up the IP source and schema

You can develop an IP for your data source by starting with the template IP or an example installed with OpenAccess SDK, or a sample from the DataDirect code library at:
http://www.datadirect.com/developer/code_library/index.ssp.
The steps in this section assume you are starting from the template IP installed at install_dir/ip/oajava/template. The template IP contains stubs for each IP function that you must implement.
If you start from an example installed with OpenAccess SDK, the steps are the same as if you start from the template IP, except that you replace references to template with example. For code samples downloaded from the Progress DataDirect code library, follow the instructions provided with the sample.
The template IP can be found in the install_dir/ip/oajava/template directory and contains the following file:
*damip.java - implementation of the IP API
OpenAccess SDK provides the following schema directories and files:
*The install_dir/ip/schema/template_static directory contains the minimal OA_TABLES, OA_COLUMNS, OA_STATISTICS, and OA_FKEYS configuration required to use the OpenAccess SDK SQL engine schema manager.
*The install_dir/ip/schema/template_dynamic directory contains the minimal OA_TABLES and OA_COLUMNS required to support views using a dynamic schema and are used when the IP is implementing the schema management.
To set up the source and schema for a new IP:
1. Copy the contents of the install_dir/ip/oajava/template directory and all of its subdirectories to the directory install_dir/ip/oajava/yourip and rename the template files. For example, on UNIX, perform the following commands, replacing yourip with the name you have chosen for your IP:
a. cd install_dir/ip/oajava
b. mkdir yourip
c. cp -r template/* yourip
d. cd yourip
e. mv damip.java yourip.java
2. Edit the IP files you placed in the install_dir/ip/oajava/yourip directory to modify them for your IP-specific file names.
a. Edit yourip.java and replace package oajava.template with your IP's filename, for example:
package oajava.yourip
b. Change the name of the class from damip to yourip.
c. Change the name of the class constructor from damip() to yourip().
3. Compile the IP files:
a. Change to directory install_dir/ip/oajava/yourip.
b. Set the CLASSPATH to include install_dir/ip/oajava/oasql.jar and any additional files your IP needs to reference.
c. javac yourip.java
The name of the IP class that implements the oajava.sql.ip interface is specified in the DataSourceIPClass data source attribute. The OpenAccess SDK SQL engine creates an instance of this class for each connection. You must configure the ServiceJVMClassPath service attribute with all classes your IP requires, the path install_dir/ip, and oasql.jar.
4. For schema support, perform one of the following actions:
*Dynamic schema: To implement a dynamic schema, where the IP implements the SCHEMA function, and to take advantage of SQL views, copy the contents of the install_dir/ip/schema/template_dynamic directory to the install_dir/ip/schema/yourip directory.
*Static schema: To use the static schema feature, where the OpenAccess SDK SQL engine manages the schema, set up the required schema storage files by copying the contents of the install_dir/ip/schema/template_static directory to the install_dir/ip/schema/yourip directory.
The schema directory you create is used as the DataSourceIPSchemaPath when configuring the data source for the OpenAccess SDK service using this IP.
On UNIX, perform the following commands to set up a static schema:
*cd ip/schema
*mkdir yourip
*cp -r template_static/* yourip
The development environment and schema folder for your IP are now set up. Next, set up the OpenAccess SDK service to access your data source. Refer to Debugging an OpenAccess SDK Interface Provider for details on how to debug an IP on Linux, UNIX, and Windows.