The following steps apply to the DB2 Everyplace Sample for Palm OS CLDC
project. The DB2 Everyplace Sample for Palm OS XTR project involves
similar steps.
This task is part of the main task of Compiling and running sample Java
applications on Palm OS targets. After you complete these steps, return
to Compiling and running sample Java applications on Palm OS targets.
Prerequisites
If you have not already set up your system to use the DB2 Everyplace JDBC
driver, install the following files for the JDBC driver on your device:
<DB2 Everyplace>\Clients\PalmOS\database\JDBC\cldc\DB2eJDBC.prc
<DB2 Everyplace>\Clients\PalmOS\database\JDBC\cldc\DB2eJDBC_Cldc.prc
If you are working with the DB2 Everyplace Sample for Palm OS XTR project,
install the following files for the JDBC driver on your device instead:
<DB2 Everyplace>\Clients\PalmOS\database\JDBC\xtr\DB2eJDBC.prc
<DB2 Everyplace>\Clients\PalmOS\database\JDBC\xtr\DB2eJDBC_Xtr.prc
Procedure
To run DB2eAppl.java on a Palm OS emulator:
- Configure the Palm OS emulator:
- Click Devices --> Configure.
- In the Device Configurations window, select Palm Emulator in the left
pane, then click New.
- In the configuration that appears on the right, enter the following
information:
- In the Device name field, type DB2 Everyplace Palm
Emulator.
- In the Palm emulator executable field, browse to
<PalmEmulator>\Emulator.exe, where
<PalmEmulator> is the directory where you installed the Palm
Emulator.
- In the Emulator run arguments field, type -psf
<file>.psf, where <file>.psf is a
.psf file that has DB2 Everyplace and the J9 VM installed.
- Click Apply, then click OK.
- Build DB2eAppl.java.
- In the Package Explorer View in the Java Perspective, double-click the
wsddbuild.xml file for the DB2 Everyplace Sample for Palm OS
CLDC project.
- In the editor for wsddbuild.xml, click Add
Build.
- Select J9 for Palm 68k from the Platform list, keep the default
values in the Main class and Buildname fields, then
click Next.
- On the PalmOS settings page, type DB2e in the Creator
id field, and type DB2eAppl in the App Name field,
then click Next.
- On the Jxelink Options page, keep the defaults and click
Finish.
- Modify the DB2eAppl.jxeLinkOptions file:
- In the Package Explorer in the Java Perspective, expand the
palm68k folder for the DB2 Everyplace Sample for Palm OS CLDC
project. Double-click DB2eAppl.jxeLinkOptions to open the editor
for DB2eAppl.jxeLinkOptions.
- In the editor, click the Input tab. Click New for the
Read classes from map files (prereq) section. In the Add prereq window
that appears, enter DB2eJDBC_Cldc for the prereq, then click
OK. Note: If you are working with the DB2
Everyplace Sample for Palm OS XTR project, enter DB2eJDBC_Xtr for
the prereq instead, and skip the next two steps.
- In the editor, click the Jxe tab. Under Jxe Platform Information,
click New for the Use VM options when running jxe section.
- In the Add VM option window that appears, enter
-jcl:cldc:loadlibrary=db2ejdbc for the VM option, then
click OK.
- Type Ctrl+S to save your changes.
- In the editor for wsddbuild.xml, select jxe2prc
palm68k/DB2eAppl, then click Perform Build.
- Run DB2eAppl.java.
- Click Run -->Run from the main menu. The Launch
Configurations window opens.
- In the Launch Configurations window, select Device Java Application in the
left pane, then click New.
- In the configuration that appears in the right pane, type DB2eAppl
Palm CLDC in the Name field.
- In the Java Application panel, enter the following information:
- In the Project field, browse to DB2 Everyplace Sample for Palm OS
CLDC.
- Click Search in the Java Application field.
- In the Select Target window, select DB2eAppl.prc (Target
"jxe2prc palm68k/DB2eAppl" in wsddbuild.xml), then click
Finish.
- Select DB2 Everyplace Palm Emulator from the Device or JRE
list.
- Back in the Launch Configurations window, click Apply, then
click Run. A Palm Emulator should start and run
DB2eAppl. You should see output for the sample application either on
the Palm Emulator screen, or in the j9stdout.txt file in the
directory that your .psf file is in. If you did not modify the
J9 Java VM "Display Stdout on Screen" preference, the output will be in the
j9stdout.txt file. Also check
j9stderr.txt for errors.
Return to Compiling and running sample Java applications on Palm OS targets.