Home | Previous Page | Next Page   Creating Java User-Defined Routines > Registering Java User-Defined Routines >

Specifying the JVP

To execute, a UDR written in Java code must run in a JVP. The JVP is a predefined virtual-processor class that contains a JVM to interpret Java byte codes. Use the following syntax to specify that a UDR should execute in the JVP class:

WITH (class='jvp')

By default, most UDRs run in the CPU VP, which does not contain a JVM. However, a UDR written in Java code runs on a JVP by default. Therefore, the CLASS routine modifier is optional when you register a UDR written in Java code. To improve readability of your SQL statements, include the CLASS routine modifier when you register a UDR.

For example:

-- Specifying the JVP
CREATE PROCEDURE showusers()
   WITH (class='jvp')
   EXTERNAL NAME 'thisjar:admin.showusers()'
   LANGUAGE java;
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]