I actually got some feedback from a couple of users of my JDBC Providers contribution to JSPWiki, and I’ve updated the page provider accordingly.
There is some question about the overall design, which I adopted from an earlier database page provider. The page provider keeps two tables. VERSIONS has every version of every page, and PAGES has only the most recent version of every page. PAGES is unnecessary and basically serves as a cache for VERSIONS, and I don’t know how much that helps. Further, if one does find it valuable to keep a separate PAGES table, is it worthwhile to keep all versions in VERSIONS?
It would be possible to store all-but-the-latest version in VERSIONS, but the redunancy has some advantages. It means you only have to look in one table to get the page history. And it makes updating a page a little simpler. Without redundancy, it would be a copy from PAGES to VERSIONS and an update of PAGES. With redundancy, its an insert in VERSIONS and an update of PAGES.
Rather than worry about table layouts, I think the next step is to move all the SQL statements into the properties file so they could be customized for other databases. Eventhough the code is generic JDBC, some of the SQL is not universal and it’s only been tested with MySQL (though one user is using MS SQL Server).