Will code that communicates with a Ms Access 2007 database work with a Ms Access 2003 database as well? And vice versa. How compatible is all the JDBC stuff 开发者_开发知识库with different versions?
Thanks.
There is an odbc-jdbc bridge, so Java can connect to everything you can setup an ODBC driver to.
Of course, the drivers mostly just "pass" the SQL to the database, so if your code used querys specific of a database they will work on that database but won't on anything else.
Although SQL is a standard, db vendors provide "extra" functionality that is not necessarily standard. Depends on your usage. I am not an expert in MS Access, but I would say assume it is not compatible until you are able to prove that it is
It would depend on your jdbc driver, but as long as you're not doing any vender specific calls, (ie: custom types for cursors or vender specific sql) you shouldn't have any problems.
So to answer your question, the jdbc code will port, but the sql may not.
Is the MS Access 2007 database in ACCDB format? If so you need to use the appropriate ACE driver. Now this will work just against an Access 2003 format database file so long as ACE is installed on the client system. If not then you'll want to use Jet 4.0 which is part of every Windows OS since Windows 2000.
精彩评论