Neoview Guide to Stored Procedures in Java (R2.5)

Table of Contents
About This Document.......................................................................................................11
Intended Audience................................................................................................................................11
New and Changed Information in This Edition...................................................................................11
Document Organization.......................................................................................................................11
Notation Conventions...........................................................................................................................12
General Syntax Notation.................................................................................................................12
Related Documentation........................................................................................................................14
Neoview Customer Library.............................................................................................................14
Publishing History................................................................................................................................15
HP Encourages Your Comments..........................................................................................................16
1 Introduction...................................................................................................................17
What Is an SPJ?.....................................................................................................................................17
Benefits of SPJs......................................................................................................................................17
Java Methods Callable From Neoview SQL....................................................................................18
Common Packaging Technique.......................................................................................................18
Security............................................................................................................................................18
Increased Productivity.....................................................................................................................18
Portability........................................................................................................................................19
How Do I Use SPJs in a Neoview Database?........................................................................................19
2 Getting Started.............................................................................................................21
Required Software on the Neoview Platform.......................................................................................21
Required Software on the Client Workstation......................................................................................21
Java Development Kit......................................................................................................................21
HP Database Manager (HPDM)......................................................................................................21
Recommend Software on the Client Workstation................................................................................22
Neoview Command Interface (NCI)...............................................................................................22
Neoview JDBC Type 4 Driver..........................................................................................................22
3 Developing SPJ Methods.............................................................................................23
Guidelines for Writing SPJ Methods.....................................................................................................23
Signature of the Java Method..........................................................................................................23
Public Access and Static Modifiers............................................................................................23
Void Return Type.......................................................................................................................23
Java Parameters..........................................................................................................................23
Returning Output Values From the Java Method...........................................................................24
Using Arrays for Output Parameters.........................................................................................25
Type Mapping of Output Parameters........................................................................................25
Returning Stored Procedure Result Sets.........................................................................................25
Using the main() Method................................................................................................................27
Null Input and Output....................................................................................................................27
Static Java Variables.........................................................................................................................27
Nested Java Method Invocations.....................................................................................................27
Accessing a Neoview Database............................................................................................................28
Use of java.sql.Connection Objects..................................................................................................28
Closing Default Connections.....................................................................................................28
Default Connection URL............................................................................................................28
Table of Contents 3