Skip to main content

JDBC & Personal Profile / Cannot open include file: 'windows.h'

2 replies [Last post]
t56
Offline
Joined: 2009-03-11

Hi all,
I'm trying to get JDBC working with pMEA Personal Profile and was using the instructions on Mayuresh's blog

http://blogs.sun.com/wittyman/entry/building_jdbc_for_cdc_foundation

in order to produce a jdbc.jar (jsr169).

For step 4.2, it says to run the command
/bin/javac -bootclasspath /lib/btclasses.zip:
/lib/basis.jar -d java/sql/*.java

and for Step 4.3,
/bin/javac -bootclasspath /lib/btclasses.zip:
/lib/basis.jar -d javax/sql/*.java

and as I'm using personal profile, I need to use "personal.jar" instead of "basis.jar".

I had been using Davy's pMEA PP binary
http://www.cs.kuleuven.be/~davy/phoneme/?q=node/10

but that doesn't have a personal.jar file in it, so I tried to build the thing myself.
Unfortunately, when I build it, I get the following error

---------------------------------Start of Error Message---------------------------------------
Checking for phoneME Advanced classes to compile ...
make[1]: Entering directory `/pmea/cdc/build/win32-arm-wm5'
make[1]: Leaving directory `/pmea/cdc/build/win32-arm-wm5'
Checking for test classes to compile ...
Compiling test classes...
... /pmea/cdc/build/win32-arm-wm5/testclasses.zip
Checking for demo classes to compile ...
Compiling demo classes...
... /pmea/cdc/build/win32-arm-wm5/democlasses.jar
... /pmea/cdc/src/share/javavm/include/opcodes.list
jcc romjava.c files
1277 Total Classes
... of which 270 classes have static initializers
(11208/16839 quickening sites)
12000 method blocks
... of which 12000 blocks are writable
... for 1168 classes
... of which 3635 have checkinit opcodes in the code
588383 bytes of Java code
2127 catch frames
5179 field blocks
1070 inner class attribute entries
16282 constant pool entries
6272 Java strings
... /pmea/cdc/build/win32-arm-wm5/./generated/javavm/runtime/system_properties.c
cc /pmea/cdc/src/share/javavm/runtime/gc/generational/gen_semispace.c
gen_semispace.c
../../src/win32\javavm/include/win32/windows.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or director
y
make: *** [obj/gen_semispace.o] Error 2

---------------------------------End of Error Message---------------------------------------

(1) Does anyone know what is wrong?
Maybe I'm missing an environment variable. Do I need to use his patches
(http://www.cs.kuleuven.be/~davy/phoneme/?q=node/8)
and if so, how do you do that with Cygwin)?
or, alternatively
(2) Is there somewhere I can just get the jdbc.jar (jsr169.jar) file and then just use it with Davy's pMEA binary (something like cvm -Xbootclasspath/a:jsr169.jar ...) ?

Many thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
t56
Offline
Joined: 2009-03-11

Davy, you're a star!!! That worked a treat. At last I got the SimpleMobileApp Derby database demo example working on my Windows Mobile 5 emulator using your binary (I used the WM5 phoneME Advanced - Personal Profile b110 download). Thanks so much for your help.

After building the jdbc.jar, I had a bit of trouble using the correct arguments to run the application, so I'll mention what I did for any other novices like me.
Once you have built the jdbc.jar using Davy's instructions (above),

(1) Create a file called "MyApp.lnk" containing the line:
255#"\Storage Card\bin\cvm.exe" -f "\Storage Card\myApp-args.txt"

(2) Create another file called "myApp-args.txt" containing the line:
"-Xopt:stdioPrefix=\Storage Card" "-Xbootclasspath/a:\Storage Card\jdbc.jar" -cp "\Storage Card\derby.jar;\Storage Card\SimpleMobileApp.jar" SimpleMobileApp

I copied derby.jar & jdbc.jar into the "Storage Card" directory too.
The output of the application will appear in a file called "OUT.TXT", i.e.

SimpleMobileApp started
Connected to and created database simpleMobileDB
Created table streetaddr
Inserted 1956 Webster
Inserted 1910 Union
Updated 1956 Webster to 180 Grand
Updated 180 Grand to 300 Lakeshore
Verified the rows
Dropped table streetaddr
simpleMobileDB shut down successfully
SimpleMobileApp finished

PS - If you look at the second URL below, under the section "Runtime Examples", you'll see how to set up the Storage Card directory (or whatever you want to call it).

URLs I used:
-------------------
http://www.cs.kuleuven.be/~davy/phoneme/?q=node/1
http://wiki.java.net/bin/view/Mobileandembedded/PhoneMEAdvancedGSGWinMobile
http://wiki.apache.org/db-derby/JavaMESupport

Thanks again for all your help Davy,
John.

davyp
Offline
Joined: 2007-01-03

The Windows Mobile 2003 build contains the personal.jar. For the WM5 and
WM6 releases, the personal.jar was named rt.jar.

I think you can also compile the jdbc sources as follows:

cd jdbc_cdc1.0/cdcfoundation/src/share/jdbc/classes/
mkdir build
javac -source 1.4 -target 1.4 -d build java/sql/*.java javax/sql/*.java
cd build
jar cvf jdbc.jar java/sql/*.class javax/sql/*.class

Davy