J2ME - Database
Hi. Is there some implementation of database I can use in MIDlet.
I'd like to create an apliaction that has a local relational database in MIDlet and from time to time data is synchronized with external database on serwer (can i use JDBC?)
Please recommend me some api i can use for this purpose, maybe some articles.
BR.
Mathew
[362 byte] By [
mcwoa] at [2007-11-27 10:33:00]

# 1
Mathew
For the first part of your question -- no, there's no relational database in J2ME (how much do you really expect a phone processor / OS to be cpaable of!). You can use rms, look it up, plenty of information on the forums and tutorials, but any relations you need between tables will have to be taken care of in your code. Tedious? maybe. Challenging? DEFINITELY!
Before you get going, please note that rms permits storing and retrieval of byte arrays; there is NO table or record definition, NO index and a limit (unless otherwise specified in the jad) of 200 kB.
Sorry I have no idea about server-related matters, I'm sure someone will reply to that part of your query.
How many tables and what kind of relations do you need to implement? Do you need a simple many-to-one relationship / lookup table ir do you need something more sophisticated like insert / delete / update triggers?
Regards, Darryl
# 2
Hi mcwo ,
As Darryl said it, there is no Database thing in mobiles right now except I have heard one Windows Mobile which has a miniature of SQL Server on it but that is certainly an exception (even I am not sure if its there or not).
So to implement a relational database u have to create ur own data structure and store it in mobile. J2ME gives u two kinds of storage,
1. RMS
2. File Storage (using File Connection API)
The second thing, synchronization with the server database, well for that u have to have a middleware application which will done the synchronization upon receiving request from the client i.e. the J2ME app on the mobile using GCF.
And the whole thing now depends on u how u are going to implement these. However on the API's u will find plenty of stuffs in the net.
Regds,
SD