Last Update: 28 February 2007
Product: StarSQL for Java
Version: 2.31 or later
Article ID: SQV00SJ003
This document describes how to use the StarSQL for Java driver to access a DB2 database from an Oracle database.
The basic steps for connecting an Oracle database to a DB2 database using StarSQL for Java are to:
The following sections detail the steps for using the StarSQL for Java driver to connect to DB2 from an Oracle 10i database that is configured to use the Java Virtual Machine (JVM) version 1.4 or later. The procedures for other versions of the Oracle database may differ slightly, such as the location where the software is installed, but should be similar.
The StarSQL for Java license file, Starlicense.properties, must be copied to a directory that can located by the Oracle JVM. Be sure to configure the Starlicense.properties file with the appropriate information before copying the file.
loadjava -u userid/password -verbose -resolve -resolver "((* PUBLIC) (* SYS) (* SYSTEM) (* -))" -grant PUBLIC "C:\Program Files\StarQuest\starsql_java\StarSQL_JDBC.jar"
loadjava -u userid/password -verbose -resolve -resolver "((* PUBLIC) (* SYS) (* SYSTEM) (* -))" -grant PUBLIC C:\java\execQuery.class
call dbms_java.grant_permission( 'SYSTEM', 'SYS:java.net.SocketPermission','db2host.domain.com', 'connect,resolve' );
call dbms_java.grant_permission( 'SYSTEM', 'SYS:java.io.FilePermission', 'C:\oracle\product\10.2.0\db_1\javavm\lib\Starlicense.properties', 'read' );
call dbms_java.grant_permission( 'SYSTEM', 'SYS:java.net.SocketPermission','starlic', 'connect,resolve' );
create or replace procedure do_Query(sqlString
varchar2, db varchar2)
as language java
name 'execQuery.doQuery(java.lang.String,java.lang.String)';
/
set serveroutput on
call dbms_java.set_output(10000);
begin
do_Query('select * from TABLE','Production');
end;
/
If you wish to update the StarSQL for Java driver with a newer version, use the dropjava command to unload the driver from the Oracle database:
dropjava -u userid/password -verbose -resolve -resolver "((* PUBLIC) (* SYS) (* SYSTEM) (* -))" -grant PUBLIC "C:\Program Files\StarQuest\starsql_java\StarSQL_JDBC.jar"
The information in technical documents comes without any warranty or applicability for a specific purpose. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The instructions may need to be modified to be appropriate for the hardware and software that has been installed and configured within a particular organization. The information in technical documents should be considered only as an example and may include information from various sources, including IBM, Microsoft, and other organizations.