DB2 supports the Java stored procedure, which can be run on the server side by the application. Follow these guidelines to create the Java stored procedure:
To create, register, and use a Java stored procedure in an application, follow these steps:
Below example shows the stored procedure. Make sure that the class should be public and extends the StoredProc class. The method in the class should be public void. The OUT parameter values are set using the set function.
Compile the above class using the javac compiler.
Copy the CreateOrder.class to the sqllib/function directory.
Register the stored procedure using the following command:
Call the stored procedure from the client program. The createPorder method of the application calls this stored procedure to create the PORDER column value for the PURCHASEORDER table. You can call this stored procedure from the command line using the following command:
where poid is the purchase order ID and cart is the table name. Before calling the stored procedure, make sure that the poid value does not exist in the PURCHASEORDER table and CART table has the PID and QUANTITY columns of varchar(10) and int data type respectively. Also, populate the CART table with product ID and quantity values. PID inserted in this table should exist in the PRODUCT table. The stored procedure returns the XML value in its output parameter denoted by the question mark (?) while calling the stored procedure.
IBM DB2 Related Interview Questions
|IBM Websphere Interview Questions||IBM-REXX Interview Questions|
|IBM Cognos Interview Questions||IBM DB2 Interview Questions|
|J2EE Interview Questions||COBOL Interview Questions|
|IBM-JCL Interview Questions||DB2 Using SQL Interview Questions|
|IBM WAS Administration Interview Questions||IBM WebSphere Administration Interview Questions|
|Database Administration Interview Questions||DB2 SQL Programming Interview Questions|
|Mainframe DB2 Interview Questions|
IBM DB2 Related Practice Tests
|IBM Websphere Practice Tests||IBM Cognos Practice Tests|
|IBM DB2 Practice Tests||J2EE Practice Tests|
|COBOL Practice Tests||IBM-JCL Practice Tests|
|DB2 Using SQL Practice Tests||IBM WAS Administration Practice Tests|
|Database Administration Practice Tests||DB2 SQL Programming Practice Tests|
Ibm Db2 Tutorial
Db2 Application Development Overview
Application Development With Db2 Purexml
Application Development With Php
Application Development With C/c++
Application Development With Java
Application Development With .net
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.