From: Calvin S. <cal...@ho...> - 2005-02-23 22:10:00
|
>First of thanks to whomever did the Java port, I believe it was Calvin >Smith. Yep it was me. Thanks for the report. good to hear someone is using this stuff Bug 1) looks like a bug to me, just fixed it and checked it in Bug 2) that bug may or may not have been in the C code. I have found other places where the C code was wrong bug did not segfault. can you try the 0.5 version of the C code and see if it's also broke there? keep in mind the C code may return the correct result but still be corrupting memory Current plans are to sync the libmdb package to current cvs thereby picking up new feature and bug fixes. JDBC driver works well for common cases so it tends to get less attention until someone like yourself reports the bug and / or offers a patch Thanks again ----Original Message Follows---- First of thanks to whomever did the Java port, I believe it was Calvin Smith. I need to read data from an mdb file on a Linux system via a Java servlet, and this project (almost) allowed me to do that. I first used the libmdb package ala mdb_export, but I found the test code that does DriverManager.getConnection("jdbc:mdbtools:" + filename), which worked well. Even though very little of the java.sql interfaces are implemented, we have Statement.executeQuery and ResultSet.getString, which are sufficient for my purposes. Thanks again! Other posts indicate that the Java port is a bit out-of-date, so perhaps the memo bug I describe below has been fixed in the C version. From the libmdb code, it looks like some manual intervention is required to turn the C into Java, so perhaps this is why. I am not part of the mdbtools team and have not participated in any such project, so I will describe two bugs I found and apologize for not fixing them. 1) Java bug (crucial, but trivial): in DataResultSet.getString(String), the method loops through the column names to get the index to call DataResultSet.getString(int), which does the real work. DataResultSet.getString(int) correctly accounts for the fact that ResultSet.getXXX(int) method number the columns from 1, as does SQL. However, DataResultSet.getString(String) does not account for the offset. Line 168 "return getString(i);" in the for loop should be return "getString(i + 1);". (I'm not sure what the plans are for the Java wrappers, but obviously a table from column names to indices in DataResultSet would be better.) 2) I'm getting various index out of bounds errors from mdbtools.libmdb.Data.mdb_memo_to_string that are preventing me from reading tables that have a column of type "memo". I can't even query the other columns because the current implementation reads the entire tale into memory, no matter what columns are in the query (right?). I'm getting negative values for the string length and a value > 4096 for row_start, which is used as an index into MdbHandle.page_buf. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ mdbtools-dev mailing list mdb...@li... https://lists.sourceforge.net/lists/listinfo/mdbtools-dev |