DB2 provides sample programs, used in the following sections, to demonstrate building and running JDBC programs that exclusively use dynamic SQL, and SQLJ programs that use static SQL. The Java samples are located in the sqllib/samples/java directory. The directory also contains a README and a makefile. Please see the section "The Java makefile".
Before modifying or building the sample programs, it is recommended that you copy them from the sqllib/samples/java directory to a separate working directory.
To run these sample programs, you must first create and populate the sample database by entering:
db2sampl
General Points for Building and Running DB2 Java Programs
db2start