Skip Headers

Oracle8i Server Installation and Database Administration Guide
Release 3 (8.1.7) for Fujitsu Siemens Computers BS2000/OSD

Part Number A95466-01
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

12
Java in the Database

This chapter describes what is BS2000 specific for Java in the database. Parts of this chapter are:

For more information see Oracle8i Java Documentation (a complex of manuals).

Installation of a Java Enabled Database

In order to not disturb non-Java users and save resources not used outside Java (e.g. memory pool size, disk space, CPU overhead) Java must be explicitly enabled in ORAENV file:

ENABLE_JAVA=TRUE

When ENABLE_JAVA is set to FALSE (which is also the default value), Java in the database is switched off.

Since Oracle 8.1.7 (for the first time) Oracle is using Posix interfaces. This does not mean that Oracle 'is running in Posix' or 'is under control of Posix', the difference is, that a few Posix APIs will be used by Oracle whereas the overwhelming majority of APIs is still native BS2000 (e.g. PAM calls, common memory pools, sockets etc.).

However, some prerequisites are necessary to install a java enabled database:

When you try to make an existing Oracle817 database Java enabled you can use the Java related parts of this procedure as an example and modify it according to your needs (i.e. increase dbsize, increase shared_pool_size, create a large rollback segment, run initjvm.sql etc.) For more information see Oracle8i Java Developer's Guide.


Note:

In a Java Enabled Database a trigger aurora$server$shutdown is defined which fires before shutdown of the database. This can result in starting an event monitor process during shutdown, thus slowing down the shutdown. This trigger is only needed for dynamic listener registration for the MTS server. If you do not use Multi Threaded Servers, you can prevent this event monitor process by running the following SQL command when connected as internal: DROP TRIGGER aurora$server$shutdown


When after successful installation you get the message

CCM0090: ALL UFS TERMINAL DEVICES ARE IN USE OR PERMISSION DENIED

you should ask your BS2000 administrator to increase the number of UFS devices by modifying the parameter NOSTTY in the configuration file SYSSSI.POSIX-BC.version.

Where can files related to Java reside and how should they be encoded?

It is not absolutely straightforward where files used by Java have to be stored and how they should be encoded. In general files can reside in native BS2000 or in the Posix file system, but there are exceptions. The following table gives an overview:

Statement or API File type Place Default
encoding
Encoding
modification
CREATE JAVA CLASS
USING BFILE
.class BS2000 PAM file or POSIX binary not applicable
CREATE JAVA RESOURCE
USING BFILE
.properties BS2000 PAM file or POSIX ascii none (i.e. there is no means to change default encoding)
CREATE JAVA SOURCE
USING BFILE
.java, .sqlj BS2000 PAM file or POSIX ascii execute dbms_java.
set_compiler_option
(' ', 'encoding', 'WE8BS2000')
CREATE JAVA SOURCE AS .sql part of statement session character set specified in NLS_LANG NLS_LANG
CALL DBMS_JAVA.
LOADJAVA
*, .jar, .zip POSIX none option encoding in loadjava call
(i.e this is a required parameter of dbms_java.loadjava
java.io-package * POSIX DB charset depends on the classes used

BS2000 PAM files in ascii can be created by file transfer (ftp) from an ascii platform to BS2000 in binary mode.

The distinction between a native BS2000 file name and a Posix file name is made by the preceeding slash ('/'). As a consequence no relative path names are allowed for Posix filenames.
However there is one exception: when used within dbms_java.loadjava relative path names are preceeded by the value of JAVA_HOME in ORAENV file (see above).

Database character sets and Java encodings

As far as Input/Output is concerned, the Oracle JAVAVM uses the database character set as system property file.encoding. Therefore the following Oracle/BS2000 database character sets have been added to the list of supported Java encodings:

WE8BS2000
WE8BS2000E
EE8BS2000
CE8BS2000
CL8BS2000
WE8BS2000L5

These encodings are not known to any other Java implementation.

The system property file.encoding, however, does not apply to Java property files. Property files always use the encoding 8859_1 (see Oracle8i SQLJ Developer's Guide and Reference). The system property file.encoding is not used when compiling a source file. Instead the default is latin1 (see Oracle8i Java Developer's Guide). You can change this default by either using the procedure

dbms_java.set_compiler_option('','encoding',...)

or by setting the encoding option of the procedure dbms_java.loadjava.

Due to a bug in the Oracle JAVAVM you always have to set the encoding option when loading a source file with dbms_java.loadjava.

Loadjava

This utility is not available on BS2000, however you can use within SQL*Plus the dbms_java.loadjava (resp. dropjava) package which is almost as capable as the loadjava utility (for more information see Oracle8i Java Documentation).

Of course you can use the loadjava utility from a Unix or Windows platform to load Java objects into a BS2000 Oracle8i database.

Java Demonstration Files

A simple Java demonstration program running in the server is shipped under: $ORACL817.JAVAVM.DEMO.HELLO.SQL

An example with database connection using the server-side internal driver is shipped under:
$ORACL817.JAVAVM.DEMO.EMPLOYEE*

Restrictions

We don't support


Go to previous page Go to next page
Oracle
Copyright © 2001 Oracle Corporation.

All Rights Reserved.
Go To Table Of Contents
Contents
Go To Index
Index