This readme describes how to create Java a stored procedure that uses the Intenz display class "SpecialCharacters". The readme is part of a .zip file which includes sources/jars/classes mentioned below.
Author: markr@ebi.ac.uk pmatos@ebi.ac.uk
Note: as this is in a 10G database, make sure you set your EBI Oracle working environment to 10G. (on the cluster thats using oracle home /sw/arch/dbtools/oracle/product/10.1.0.2)
NB: Currently the load java utility and dropjava only works on 32 bit so you can't use 64 bit. You need to log into dodo and setup your script as follows:
setenv ORACLE_BASE /sw/arch/dbtools/oracle
setenv ORACLE_HOME /sw/arch/dbtools/oracle/product/10.1.0.2
setenv CLASSPATH $ORACLE_HOME/JRE/lib:$ORACLE_HOME/jlib:$ORACLE_HOME/jdbc/lib/classes111.zip
setenv ORACLE_TERM vt100
setenv TNS_ADMIN $ORACLE_HOME/network/admin
setenv ORACLE_PATH $ORACLE_HOME/bin
setenv ORA_NLS32 $ORACLE_HOME/ocommon/nls/admin/data
setenv NLS_LANG american_america.us7ascii
setenv NLS_DATE_FORMAT "DD-MON-RRRR HH24:MI:SS"
setenv LD_LIBRARY_PATH $ORACLE_HOME/lib
set path = ( $ORACLE_PATH $path )
The xchars.jar used is included in the zip file.
For example: loadjava -resolve -user chebi_dev10/XXXXX@dev10 xchars.jar
To drop a class then: dropjava -resolve -user chebi_dev10/XXXXX@dev10 uk/ac/ebi/xchars/domain/CharacterClass.class
For example: loadjava -resolve -user chebi_dev10/XXXXX@dev10 xchars-database-1.0.jar
For example:
>> select object_type, status, count(*) from user_objects group by object_type, status
OBJECT_TYPE STATUS COUNT(*)
LOB VALID 1
INDEX VALID 1
TABLE VALID 1
JAVA CLASS VALID 29
JAVA RESOURCE VALID 1
Example:
begin
dbms_java.grant_permission( 'CHEBI_DEV10', 'SYS:java.io.FilePermission', '/ebi/sp/pro1/intenz/special_characters' , 'read' );
dbms_java.grant_permission( 'CHEBI_DEV10', 'SYS:java.io.FilePermission', '/ebi/sp/pro1/intenz/special_characters/specialCharacters.dtd' , 'read' );
dbms_java.grant_permission( 'CHEBI_DEV10', 'SYS:java.io.FilePermission', '/ebi/sp/pro1/intenz/special_characters/specialCharactersMapping.dtd' , 'read' );
dbms_java.grant_permission( 'CHEBI_DEV10', 'SYS:java.io.FilePermission', '/ebi/sp/pro1/intenz/special_characters/specialCharacters.xml' , 'read' );
commit;
end;
SET SERVEROUTPUT ON
CALL dbms_java.set_output(2000);
commit;
>> select xml_display_sp_code ('/ebi/sp/pro1/intenz/special_characters/', 'specialCharacters.xml', 'greekalpha/greek-ribsome') from dual;
XML_DISPLAY('/EBI/SP/PRO1/INTENZ/SPECIAL_CHARACTERS/','SPECIALCHARACTERS.XML','GREEKALPHA/GREEK-RIBSOME') ----------------------------------------------------------------------------------------------------------------------------------- alpha-ribsome
Where DEV_DEV10.EBI.AC.UK is the name of the database link.
To view all database links on a schema:
select * from all_db_links;