skip to main content
Setting Up the oajava Sample : Setting up the oajava sample on Linux/UNIX/Windows
 

Setting up the oajava sample on Linux/UNIX/Windows

The following steps provide the process of building the IP and configuring the OpenAccessSDK810_Java_SQL service to use the supplied oajava IP to access a SQL engine using JDBC. The procedure assumes that you have installed OpenAccess SDK and are using the OpenAccess SDK Management Console on Windows to manage the OpenAccess SDK installation on a Linux or UNIX machine.
1. Build the IP module:
a. Set CLASSPATH to install_dir\ip\oajava\oasql.jar.
On Windows for the Server version of OpenAccess SDK:
c:\> set CLASSPATH=c:\program files\ datadirect\oaserver81\ip\oajava\oasql.jar
On Windows for the Local version of OpenAccess SDK:
c:\> set CLASSPATH=c:\program files\ datadirect\oaodbclocal81\ip\oajava\oasql.jar
b. Change to the sample directory and compile the Java classes.
c:\> cd install_dir\ip\oasqlip\oajava
c:\> javac *.java
2. Run the OpenAccess SDK Management Console and modify the OpenAccessSDK810_Java service:
a. Double-click the OpenAccessSDK810_Java_SQL node to expand it.
b. Double-click the Service Settings node to expand it.
c. Right-click the Service Settings node and select New / Attribute. Add the ServiceJavaIPUseBulkFetch attribute and set its value to Enable. Then, click OK.
d. If OpenAccess SDK is running on UNIX, continue with this step. Otherwise, skip to Step e.
Right-click the Service Settings node and select New / Attribute. Add the ServiceJavaIPCatchSigSegv attribute and set its value to Disable. Then, click OK.
e. Select the IP Parameters node to expose its attributes.
Double-click the ServiceJVMClassPath attribute and add the JAR files required for your JDBC driver. Then, click OK.
Right-click the IP Parameters node, and select New / Attribute. Select the ServiceJVMOptions attribute and set its value to -Xms4M -Xmx8M. Then, click OK.
f. Double-click the Data Source Settings node to expand it, and then double-click the Default node.
Select the DataSourceIPClass attribute. Then, modify the class name of the IP to oasqlip/oajava/jdbc.
Select the DataSourceIPProperties attribute. Then, type your JDBC driver name and connection URL. The format is: driver_name | connection_url. For example:

com.ddtek.jdbc.sqlserver.SQLServerDriver|jdbc:datadirect:sqlserver://server_name:1433
g. Save the settings. If this is the Server option, then restart the OpenAccessSDK810_Java_SQL service. Otherwise, continue at Step 3.
3. From an OpenAccess SDK client, use the data source Default of the OpenAccessSDK810_Java_SQL service to connect to the oajava IP module you have just built and configured. Connections to this data source result in a connection to the JDBC driver configured in the DataSourceIPProperties attribute.
Example using Local ODBC client:
a. Start the ODBC Administrator by selecting the icon from the DataDirect program group.
b. Click the System DSN tab, and then click the Add button. The Create New Data Source window appears.
c. Select DataDirect OpenAccess  SDK 8.1 - Local; then, click Finish.
d. The DataDirect OpenAccess SDK Local ODBC Driver Setup window appears. Provide the following information on the General tab.
Data Source Name: Type a unique name that identifies this ODBC data source configuration. Examples are Accounting or OA ODBC to JDBC.
Service Name: Click the ... button to display the Services dialog box. Select OpenAccessSDK810_Java_SQL and then click OK.
Service Data Source: Click the ... button to display the Service Data Sources dialog box. Select Default and then click OK.
e. Click Test Connect to attempt to connect to the data source using the connection properties specified in the driver Setup dialog box. Enter your user name and password, and then click OK.
If the driver can connect, it releases the connection and displays a Connection Established message. Click OK. If the driver cannot connect because of an improper environment or incorrect connection value, it displays an appropriate error message. Click OK. Continue at Step 4.
Example using Client for ODBC:
e. Start the ODBC Administrator by selecting the icon from the product program group.
f. Click the System DSN tab, and then click the Add button. The Create New Data Source window appears.
g. Select DataDirect OpenAccess  SDK 8.1; then, click Finish.
h. The DataDirect OpenAccess SDK ODBC Driver Setup window appears. Provide the following information on the General tab.
Data Source Name: Type a unique name that identifies this ODBC data source configuration. Examples are Accounting or OA ODBC to JDBC.
Service Host: Type the host name where the OpenAccess SDK service runs.
Service Port: Type the TCP/IP port on which the OpenAccessSDK810_Java_SQL service is listening on for connection requests. The default value is 19988.
Service Data Source: Type Default, or click the ... button to select Default from the drop-down list.
i. Click Test Connect to attempt to connect to the data source using the connection properties specified in the driver Setup dialog box. Enter your user name and password, and then click OK.
If the driver can connect, it releases the connection and displays a Connection Established message. Click OK. If the driver cannot connect because of an improper environment or incorrect connection value, it displays an appropriate error message. Click OK.
4. See Tuning the oajava sample to configure the oajava sample to use bulk fetch mode.