Palm Database (PDB) files in Java?

醉酒当歌 提交于 2019-12-01 23:06:41

问题


Has anybody written any classes for reading and writing Palm Database (PDB) files in Java? (I mean on a server, not on the Palm device itself.) I tried to google, but all I got were Protein Data Bank references.

I wrote a Perl program that does it using Palm::PDB.pm, but I want to turn it into a servlet for a GWT app.


回答1:


The jSyncManager project at http://www.jsyncmanager.org/ is under the LGPL and includes classes to read and write PDB files -- look in jSyncManager/API/Protocol/Util/DLPDatabase.java in its source code. It looks like the core code you need from this could be isolated from the rest of the library with a little effort.




回答2:


There are a few ways that you can go about this;

  1. Easiest but slowest: Find a perl-> java bridge. This will not be quick, but it will work and it should involve the least amount of work.
  2. Find a C++/C# implementation that you have the source to and convert it (this should be the fastest solution)
  3. Find a Java reader ... there seems to be a few listed under google... however I do not have any experience with these.



回答3:


Depending on what your intended usage is, you might look into writing a simple reader yourself. The format is pretty simple and you only need to handle a couple of simple fields to parse it.

Basically there is a header for the entire file which has a 2 byte integer at the end which specifies the number of record. So just skip your way through the bytes for all the other fields in the header and then read the last field which is the number of records in the file. Be aware that the PDB format writes integers with most significant byte first.

Following this, there will be a record header for each record, the first field of which is the actual offset into the file for the record itself. Again, be aware of the byte order.

So, now you have the offsets into the file for each record in the file, which should make it very easy to read the actual records as long as you know the format of these for the type of PDB file you are trying to read.

Wikipedia has a nice overview of the header formats.




回答4:


Maybe JPilot can help? They must have a lot of Java code dealing with Palm OS data.



来源:https://stackoverflow.com/questions/1657222/palm-database-pdb-files-in-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!