DB2Applt demonstrates a dynamic SQL Java applet using the JDBC applet (or "net") driver to access a DB2 database.
To build and run this applet by commands entered at the command line:
db2jstrt 6789
javac DB2Applt.java
As an alternative to steps (1), (5) and (7), you can use the applet viewer that comes with the Java Development Kit by entering the following command in the working directory of your client machine:
appletviewer DB2Applt.html
You can also use the Java makefile to build this program.
DB2Appl demonstrates a dynamic SQL Java application using the JDBC application (or "app") driver to access a DB2 database.
To build and run this application by commands entered at the command line:
javac DB2Appl.java
java DB2Appl
You can also use the Java makefile to build this program.
Spclient is a client application that calls the Java stored procedure class, Spserver , using the JDBC application driver. Before building and running this client application, build the stored procedure class on the server. See "Stored Procedures".
To build and run this client program by commands entered at the command line:
javac Spclient.java
java Spclient
You can also use the Java makefile to build this program.
UDFcli is the client program that calls the user-defined functions implemented in the user-defined function server program, UDFsrv , using the JDBC application driver. Before building and running this client application, build the user-defined function program, UDFsrv, on the server. See "User-Defined Functions (UDFs)".
To build and run this client program by commands entered at the command line:
javac UDFcli.java
java UDFcli
You can also use the Java makefile to build this program.
Spserver demonstrates dynamic SQL PARAMETER STYLE JAVA stored procedures using the JDBC application driver. Stored procedures are compiled and stored on a server. When called by a client application, they access the server database and return information to the client application.
To build and run this program on the server by commands entered at the command line:
javac Spserver.java
db2 connect to sample
If the stored procedures were previously cataloged, you can drop them with this command:
db2 -td@ -vf Spdrop.db2
Then catalog them with this command:
db2 -td@ -vf Spcreate.db2
You can also use the Java makefile to build this program.