Rem
Rem $Header: sdoldgtf.sql13936 17-jan-2007.13:06:37 syuditsk Exp $
Rem
Rem sdoldgtf.sql
Rem
Rem Copyright (c) 2007, Oracle. All rights reserved.  
Rem
Rem    NAME
Rem      sdoldgtf.sql - <one-line expansion of the name>
Rem
Rem    DESCRIPTION
Rem      <short description of component this file declares/defines>
Rem
Rem    NOTES
Rem      <other useful comments, qualifications, etc.>
Rem
Rem    MODIFIED   (MM/DD/YY)
Rem    syuditsk    01/17/07 - load libraries required by GeoRaster for GeoTIFF
Rem                           import/export
Rem    syuditsk    01/17/07 - Created
Rem

SET ECHO ON
SET FEEDBACK 1
SET NUMWIDTH 10
SET LINESIZE 80
SET TRIMSPOOL ON
SET TAB OFF
SET PAGESIZE 100

--Note to user: replace "/full/path/to/gtflibs/" with the actual location of the xtiff-jai.jar and geotiff-jai.jar files.

alter session set current_schema=SYS;
call dbms_java.grant_permission('SYSTEM', 'java.io.FilePermission',
                                 '<<ALL FILES>>', 'read');
call dbms_java.grant_permission('MDSYS', 'SYS:java.io.FilePermission', 
                                '/full/path/to/gtflibs/*', 'read');

call dbms_java.loadjava('-resolve -force -synonym -schema MDSYS -grant PUBLIC /full/path/to/gtflibs/xtiff-jai.jar');

call dbms_java.loadjava('-resolve -force -synonym -schema MDSYS -grant PUBLIC /full/path/to/gtflibs/geotiff-jai.jar');


call dbms_java.revoke_permission('SYSTEM', 'java.io.FilePermission',
                                 '<<ALL FILES>>', 'read');
call dbms_java.revoke_permission('MDSYS', 'SYS:java.io.FilePermission', 
                                '/full/path/to/gtflibs/*', 'read');
commit;
alter session set current_schema=MDSYS;