This task is part of the main task of Compiling and running
sample Java applications on non-Palm OS targets. After you complete these
steps, return to Compiling and running sample Java applications on non-Palm OS targets.
Prerequisites
If you have not already set up your system to use the DB2 Everyplace JDBC
driver, complete the following steps:
- Copy the following files to the \Windows directory on your device:<DB2Everyplace>\Clients \WinCE \database \proc \ver \db2ejdbc.dll<DB2Everyplace>\Clients
\WinCE \database \jdbc \db2ejdbc.jarwhere proc is
the processor type and ver is the version number of
the Windows CE operating system on your device.
- Using the Windows CE Remote Registry Editor, modify the registry for your
device to include the following files on the classpath of the device:
\Windows\db2ejdbc.jar
\wsdd\lib\jclMax\database_enabler.jar
assuming you installed J9 under
the root directory of your device.
Alternatively, you can update the
DB2eAppl shortcut generated by WSDD to include the above files on the classpath:
256#"\wsdd\bin\j9.exe" "-Xbootclasspath:\Windows\db2ejdbc.jar;
\wsdd\lib\jclMax\database_enabler.jar;\wsdd\lib\jclMax\classes.zip;
\wsdd\lib\jclMax\locale.zip;\wsdd\lib\charconv.zip" "-jcl:max" "-jxe:\Temp\DB2eAppl.jxe"
Procedure
To run DB2eAppl.java on a Windows CE device:
- Configure your Windows CE device.
- Click Devices --> Configure.
- In the Device Configurations window, select PocketPC Handheld in the left
pane, then click New.
- In the configuration that appears on the right, complete the following
steps:
- In the Device name field, type DB2 Everyplace
PocketPC Handheld.
- Click Browse for the J9 runtime
location field. In the Browse for Folder on Device window, select wsdd
(assuming that you installed J9 under the root directory of your device),
then click OK.
- Click Browse for the Application
location install field. In the Browse for Folder on Device window, select
Temp, then click OK.
- Click Browse for the Shortcut install
location field. In the Browse for Folder on Device window, select Temp,
then click OK.
- Back in the Device Configurations window, click Apply, then click OK.
- Build DB2eAppl.java.
- In the Package Explorer pane in the Java Perspective, double-click the wsddbuild.xml file for the DB2 Everyplace Sample project.
- In the editor for wsddbuild.xml, click Add
Build.
- In the Create New Ant Build Target window, click Browse for the Main class field.
- In the window that opens, select DB2eAppl - (default package) - DB2 Everyplace
Sample/src, then click Finish.
- Back in the Create New Ant Build Target window, select J9 for PocketPC
ARM from the Platform list, keep the default in the Buildname field, then click Next.
- On the Jxelink Options page, keep the defaults and
click Finish.
- In the editor for wsddbuild.xml, select smartlink ppcarm/DB2eAppl,
then click Perform Build.
- Run DB2eAppl.java:
- Click Run --> Run. 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
WinCE in the Name field.
- On the Main page, complete the following steps:
- Click Browse for the Project field.
In the Project Selection window, select DB2 Everyplace Sample, then click OK.
- Click Search for the Java Application field. In
the Select Target window, select DB2eAppl.jxe (Target "smartlink ppcarm/DB2eAppl"
in wsddbuild.xml), then click Finish.
- Select DB2 Everyplace PocketPC Handheld from the Device
or JRE list.
- Back in the Launch Configurations window, click Apply, then click Run. You should see output for the
sample application in the J9 Console on your device.
Return to Compiling and running sample Java applications on non-Palm OS targets.