skip to main content
Setting Up Your Development Environment for Java : Setting Up an IP Source and Schema
 

Setting Up an IP Source and Schema

You can develop an IP for your data source by starting with the installed template IP, one of the installed examples, or a sample from the DataDirect code library at https://www.progress.com.
The steps in this section assume you are starting from the template IP installed at install_dir/ip/oasqlip/template_java. The template IP consists of stubs for each of the IP functions that you must implement.
If you start from one of the installed examples, the steps are the same as if you start from a template IP, except that you replace references to template with the example’s name. For code samples downloaded from the Progress DataDirect code library, follow the instructions provided with the sample.
See Setting Up the oaodbc Sample for details on setting up the oajava sample that is installed during the OpenAccess SDK installation. The OAJAVA sample is an implementation of a third-party SQL engine IP using JDBC as the data source API.
The template IP directory install_dir/ip/oasqlip/template_java shipped with OpenAccess SDK contains the following files:
oasqlip.java – stub implementation of the oajava.sql.sqlip interface
oasqlip_stmt.java – stub implementation of the oajava.sql.sqlip_stmt interface
To set up the source and schema for a new IP:
1. Copy the contents of the ip/oasqlip/template_java subdirectory to a directory ip/oasqlip/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/oasqlip
b. mkdir yourip
c. cp -r template/* yourip
d. cd yourip
e. mv oasqlip.java yourip.java
mv oasqlip_stmt.java yourip_stmt.java
2. Edit the IP files you placed in the ip/oasqlip/yourip directory to modify them for your IP-specific file names.
a. Edit yourip.java and yourip_stmt.java to replace package oajava.template with your IP's filename, for example:
package oasqlip.yourip
b. Change the names of the classes from oasqlip to yourip and from oasqlip_stmt to yourip_stmt.
c. Change the name of the class constructor from oasqlip to yourip and from oasqlip_stmt to yourip_stmt.
3. Compile your IP files.
a. Change to directory install_dir/ip/oasqlip/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 yourip_stmt.java
The name of the IP class that implements the oajava.sql.sqlip interface is specified in the DataSourceIPClass data source attribute. The OpenAccess SDK Server (or the Local Server) creates and instance of this class for each connection. The ServiceJVMClassPath service attribute is configured with all classes your IP requires, the path install_dir/ip, and oasql.jar
The development environment and the schema folder for your IP are now set up. Refer to Debugging an OpenAccess SDK Interface Provider for information on debugging a Java IP.