Application Development Guide

Java Samples


Table 45. Java Database Connectivity (JDBC) Sample Programs
Sample Program Name Program Description
DB2Appl.java
A JDBC application that queries the sample database using the invoking user's privileges.
DB2Applt.java
A JDBC applet that queries the database using the JDBC applet driver. It uses the user name, password, server, and port number parameters specified in DB2Applt.html .
DB2Applt.html
An HTML file that embeds the applet sample program, DB2Applt . It needs to be customized with server and user information.
DB2UdCli.java
A Java client application that calls the Java user-defined function, DB2Udf .
Dynamic.java
Demonstrates a cursor using dynamic SQL.
MRSPcli.java
This is the client program that calls the server program MRSPsrv. The program demonstrates multiple result sets being returned from a Java stored procedure.
MRSPsrv.java
This is the server program that is called by the client program, MRSPcli. The program demonstrates multiple result sets being returned from a Java stored procedure.
Outcli.java
A Java client application that calls the SQLJ stored procedure, Outsrv .
PluginEx.java
A Java program that adds new menu items and toolbar buttons to the DB2 Web Control Center.
Spclient.java
A JDBC client application that calls PARAMETER STYLE JAVA stored procedures in the Spserver stored procedure class.
Spcreate.db2
A CLP script that contains the CREATE PROCEDURE statements to register the methods contained in the Spserver class as stored procedures.
Spdrop.db2
A CLP script that contains the DROP PROCEDURE statements necessary for deregistering the stored procedures contained in the Spserver class.
Spserver.java
A JDBC program demonstrating PARAMETER STYLE JAVA stored procedures. The client program is Spclient.java .
UDFcli.java
A JDBC client application that calls functions in the Java user-defined function library, UDFsrv .
UseThrds.java
Shows how to use threads to run an SQL statement asynchronously (JDBC version of CLI sample async.c).
V5SpCli.java
A Java client application that calls the DB2GENERAL stored procedure, V5Stp.java .
V5Stp.java
Demonstrates a DB2GENERAL stored procedure that updates the EMPLOYEE table on the server, and returns new salary and payroll information to the client. The client program is V5SpCli.java .
Varinp.java
Demonstrates variable input to Embedded Dynamic SQL statement calls using parameter markers.

Table 46. Embedded SQL for Java (SQLJ) Sample Programs
Sample Program Name Program Description
App.sqlj
Uses static SQL to retrieve and update data from the EMPLOYEE table of the sample database.
Applt.sqlj
An applet that queries the database using the JDBC applet driver. It uses the user name, password, server, and port number parameters specified in Applt.html .
Applt.html
An HTML file that embeds the applet sample program, Applt . It needs to be customized with server and user information.
Cursor.sqlj
Demonstrates an iterator using static SQL.
OpF_Curs.sqlj
Class file for the Openftch program.
Openftch.sqlj
Demonstrates fetching, updating, and deleting rows using static SQL.
Outsrv.sqlj
Demonstrates a stored procedure using the SQLDA structure. It fills the SQLDA with the median salary of the employees in the STAFF table of the sample database. After the database processing (finding the median), the stored procedure returns the filled SQLDA and the SQLCA status to the JDBC client application, Outcli .
Stclient.sqlj
An SQLJ client application that calls PARAMETER STYLE JAVA stored procedures created by the SQLJ stored procedure program, Stserver .
Stcreate.db2
A CLP script that contains the CREATE PROCEDURE statements to register the methods contained in the Stserver class as stored procedures.
Stdrop.db2
A CLP script that contains the DROP PROCEDURE statements necessary for deregistering the stored procedures contained in the Stserver class.
Stserver.sqlj
An SQLJ program demonstrating PARAMETER STYLE JAVA stored procedures. The client program is Stclient.sqlj .
Static.sqlj
Uses static SQL to retrieve information.
Stp.sqlj
A stored procedure that updates the EMPLOYEE table on the server, and returns new salary and payroll information to the JDBC client program, StpCli .
UDFclie.sqlj
A client application that calls functions from the Java user-defined function library, UDFsrv .
Updat.sqlj
Uses static SQL to update a database.


[ Top of Page | Previous Page | Next Page ]