File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes CDC application with JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "CDC application with JDBC" Watch "CDC application with JDBC" New topic

CDC application with JDBC

kanishka weerasekara

Joined: Aug 13, 2008
Posts: 4
I am new to J2ME,
I have a requirement to connect a local database in an j2me application. Since CLDC does not allow jdbc connections I thought of using CDC.
The current requirement is to run it on a Window mobile 5, but it might change. Is mysql embeded a good choice for the DBMS. How to connect with it. I could n't find my information by googling.
Is there any way to run an emulator with Windows mobile(that could be added to Netbeans).
I did not start coding yet.
Thank you.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
What do you mean by "local DB" - a DB that is running on the device? I don't know that you'll find many that'll work is such a resource-constrained environment - HSQLDB and Derby may be the only workable options (or possibly SQLite if you don't mind installing native code).

As to MySql, while there is an embedded version, I doubt there's any mobile device that can run it (and it's not written in Java, so it won't run as part of JME).

Lastly, note that you can't change at will from CLDC to CDC - the device JVM needs to support that; which JVM implementation are you using?
kanishka weerasekara

Joined: Aug 13, 2008
Posts: 4
Thank you very much for the reply
Sorry for bad explaining. What i meant by local db is a database on the device.The device is a pocket pc (iPAC). It is supposed to run on Windows mobile so the SQLServer compact edition is running by default. If we can't find an open source solution it is possible to use that even, but then portability will be lost. I have used Derby in desktop application. But in Netbeans when i try to get a connection it says the java.sql is not found.
I thought of using MYsaiu JVMmysaifu. I have no experience with it.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

I thought the current version of Windows Mobile was 7. WM5 is on my old phone that died 6 months back, about 2 years past end-of-life for the product. And Java on a Windows Mobile device can be a real challenge, especially now that IBM has abandoned J9 for it.

Unless you really, really, really love that device, you'd probably be better off switching hardware. An Android-based device would support SQLite out of the box.

An IDE is no substitute for an Intelligent Developer.
kanishka weerasekara

Joined: Aug 13, 2008
Posts: 4
Thanks for the reply. I got a good solution
MySaifu jvm is working very well. It almost supports j2se 1.3

And the database is sqlite. I got it connected with a java connector.
And there seems to be other commercial jvms for windows mobile as well.
I deployed a simple awt application with a local database and it works fine upto now. Very cool work by Mysaifu team.
I agree. Here's the link:
subject: CDC application with JDBC
It's not a secret anymore!