Step back from the keyboard and take a moment to catch your breath. I know the idea of upgrading to a new major version of a software project can be a bit daunting. A completely re-written library means a whole new set of bugs to work through! Rest assured, however, the changes from Jackcess 1.x to 2.x are largely cosmetic! The core code is functionally unchanged, just shuffled around and tweaked. So, once an existing project has been updated for the new API, things should work pretty much the same as they did before (for better or worse!). That begs the question, of course, why mess everything up in the first place?
The Jackcess project is over 8 years old at this point, and as any developer knows, projects tend to accumulate cruft over the years. The available functionality has grown dramatically from the initial release while still retaining binary compatibility across most releases. This has been quite an effort and, unfortunately, has caused the API to become a bit unwieldy. The 2.x release is an attempt to rework the API to make it both more approachable for new users as well as more convenient for power users.
While an initial compile of existing code against the new 2.x API may generate a fair bit of compile warnings, many of the changes are fairly superficial (e.g. classes moving to new packages). All of the changes that were made were made in an attempt to make the API more useable and to follow API design best practices. Change for the sake of change was avoided (e.g. just "prettying" up existing method names).
Functionally speaking, Jackcess is largely unchanged. The core codebase is largely the same, just re-arranged. The only major changes regarding functionality are:
The remaining changes are largely cosmetic or just slightly different (hopefully better) ways to do the same things. Among these changes, the major ones are:
Map<String,Object>
, is now explicitly typed as
a Row. This makes code much more readable as well as allows for
additional functionality beyond the basic Map. Since the Row
interface extends Map<String,Object>
, old code
can remain largely untouched.Attachment.getFileData
now returns the "real"
data.Attachment.getEncodedFileData
if necessary.If you are using the Jackcess Encrypt project, then you will need to use a version compatible with the relevant Jackess API. Fortunately, the major versions match, so it's pretty simple:
Moving forward, all new feature development will be in Jackcess 2.x. The Jackcess 1.x code has been branched at version 1.2.14 and some bugfixes may be backported to that branch on a case by case basis. However, no new feature development will be done on the 1.x branch.
This upgrade guide attempts to hit all the high-points for upgrading from Jackcess 1.x to 2.x. If you feel that it is incorrect or missing a key bit of information, please, drop us a line!
Some additional notes from a migration effort.