We recently purchased the HXTT DBF 3.0 driver and have written a simple web application using it to a DBASEIII database (which is simultaneously used by a legacy app). Mostly it works well except for one problem described here:
When deleting a row from the database the associate table index (.CDX) is not being updated automcatically.. so it basically gets out of sync. If we run a reindex then its all updated fine but naturally this takes time and locks the table.
Is there something about the connection I need to add specifically for this to work? An insert statement appears to update index just fine. Code snippet here:
Connection deleteCon = DriverManager.getConnection("jdbc:dbf:/c:/data?lockType=DBASEIII", "", "");
String deleteSql="delete from bookings where card1 = ? and booking_no = ?";
PreparedStatement deleteStmt=deleteCon.prepareStatement(deleteSql);
deleteStmt.setString(1, "445323");
deleteStmt.setString(2, "123");
int deleteCount=deleteStmt.executeUpdate();
deleteStmt.close();
deleteCon.close()
There are connection properties that may relate and Ive tried a heck of a lot of combinations... eg. loadIndices=true;Default Index Suffix=CDX
Thanks.... Adam
|
>a DBASEIII database (which is simultaneously used by a legacy app).
Your legacy application should be not DBASEIII application since DBASEIII doesn't support CDX index. Please check it, I guess that you should use FOXPRO, VFP, or CLIPPER as lockType.
>When deleting a row from the database the associate table index (.CDX) is not
> being updated automcatically.
When use deletesAreVisible=true, your CDX won't be updated for delete sql. It's normal. Otherwise, you can zip and upload your database sample into:
ftp site: ftp.hxtt.com
ftp user: anonymous@hxtt.com
ftp password: (empty)
login mode: normal (not anonymous)
ftp port:21
upload directory: incoming
transer mode: binary (not ASCII)
After upload, you can't see that upload file, but it has been upload.
You can choose to zip and email webmaster.hxtt@gmail.com too.
>There are connection properties that may relate and Ive tried a heck of a lot
> of combinations... eg. loadIndices=true;Default Index Suffix=CDX
You needn't to set those properties since HXTT DBF will detect automatically your CDX index in default.
|