Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

9.3.2 Sample Java stored routines provided with HiRDB

Organization of this subsection
(1) Sample 1
(2) Sample 2
(3) Sample 3
(4) Sample 4

(1) Sample 1

This sample Java stored procedure obtains a calendar of the specified year and month.

The following shows an example of defining and executing the Java stored procedure using the previous Java procedure:

(2) Sample 2

This example accepts the specified date as a processing range and updates the total for the goods_no column in that range.

The example assumes that the table is defined as follows:

CREATE TABLE master_t1 (goods_no int,total_quantity dec(17,2))
CREATE TABLE tran_t1(goods_no int,quantity_1 dec(17,2),entrydate date)

The following shows an example of defining and executing the Java stored procedure using the previous Java procedure:

(3) Sample 3

This example compresses and decompresses BLOB data using gzip and ungzip.

The following shows an example of defining and executing the Java stored procedure using the previous Java function:

(4) Sample 4

This example uses a dynamic result set to return the result of retrieving two tables.