DB Selection - J2ME  
Author Message
Rene Morschhauser





PostPosted: 2003-7-30 21:06:00 Top

java-programmer, DB Selection - J2ME Hi,

I am developing an application for PDAs using IBMs
VM (J9). Now my problem is, that I want to store
data on the device. Well, I am using J2ME with
Personal Profile to do this, so file support is
present in this configuration. Now I wonder if
there exist solutions to store data and easily
retrieve it. (commercial, free, open source)

I have to store data on the device, add new
data often, update and delete old data sometimes.

1. So how do you store data, when not having present
a complete RDBMS?
2. There are RDBMS for this platform too.
Any experiences using them?
(for example Pointbase)
3 There is this JDO Option (for example
with ObjectDB) is this working well?
4. What do you think of the following options,
which I already found, but have no idea
whether they will work?

I alread checked:
-JDMB (rather minimalistic, only key/value pairs to be saved)
-JISP (produces rather big files -> not suitable for
constrained devices?)
-HSQL (Anybody got that to work within the mentioned configuration?
I think mainly the java.sql.* classes are missing in the
personal profile)
-ObjectDB (OODB with JDO, no idea exactly if this will
work for my purposes)

Any help will be appreciated
Rene

 
Josef Garvi





PostPosted: 2003-8-3 17:49:00 Top

java-programmer >> DB Selection - J2ME Hi,

I created my solution a couple of years ago (through VisualAge ME, J9), and
it was maybe not the optimal way, because I ended up calling a bit of
native PalmOS functions. But I think it could be translated into clean MIDP
Java with a bit of work, so maybe my experience is useful to you. (haven't
looked thoroughly at the personal profile, so don't know which features are
available there).

What I did was to create my own data format, where I made databases
containing a set of records (the palm device stores its data as records
which may have a maximum length of 64KB each). The first record was a
format description: a list of fieldnames followed by field sizes. Then each
record was a long string of fixed size, so I could chop out the fields by
having calculated where each byte starts (much like what primitive
databases always did). This turned out powerful enough for me - I also
added functions that would seek records matching certain criterias in
specific key fields. A nice bonus compared with normal databases was that I
could flag each record by type on the palm, and thus have one database
containing different tables' records (which avoids creating a lot of files
that make the palm look messy). And once I got the infrastructure built up,
using it in my different apps was very easy.

The down side however is that if the fields are fixed-length, the size of
each record becomes much bigger than the data stored in it. On the other
hand, if I would have made it dynamic-length, it would have taken more
processing power and handheld devices don't (or at least didn't) have very
fast processors.

Well, that was just to share some of my experience. Good luck!


Josef


--
Josef Garvi

"Reversing desertification through drough tolerant trees"
http://www.eden-foundation.org/

new income - better environment - more food - less poverty

 
David Morse





PostPosted: 2003-8-7 2:19:00 Top

java-programmer >> DB Selection - J2ME FirstSQL will be releasing FirstSQL/J Mobile, a version for J2ME CDC in the
near future (Sept. hopefully). It will be based on the Professional ORDBMS
version but using the CDC Personal Profile. See www.firstsql.com for more
info on what the Professional version provides.

FirstSQL Team.

"Rene Morschhauser" <email***@***.com> wrote in message
news:email***@***.com...
> Hi,
>
> I am developing an application for PDAs using IBMs
> VM (J9). Now my problem is, that I want to store
> data on the device. Well, I am using J2ME with
> Personal Profile to do this, so file support is
> present in this configuration. Now I wonder if
> there exist solutions to store data and easily
> retrieve it. (commercial, free, open source)
>
> I have to store data on the device, add new
> data often, update and delete old data sometimes.
>
> 1. So how do you store data, when not having present
> a complete RDBMS?
> 2. There are RDBMS for this platform too.
> Any experiences using them?
> (for example Pointbase)
> 3 There is this JDO Option (for example
> with ObjectDB) is this working well?
> 4. What do you think of the following options,
> which I already found, but have no idea
> whether they will work?
>
> I alread checked:
> -JDMB (rather minimalistic, only key/value pairs to be saved)
> -JISP (produces rather big files -> not suitable for
> constrained devices?)
> -HSQL (Anybody got that to work within the mentioned configuration?
> I think mainly the java.sql.* classes are missing in the
> personal profile)
> -ObjectDB (OODB with JDO, no idea exactly if this will
> work for my purposes)
>
> Any help will be appreciated
> Rene
>