I c开发者_开发百科ould not find any jdbc driver for ms access.So how can I connect MS Access with JPA ?
AFAIK, the only free drivers available are JDBC-ODBC bridges (type 1).
The JDBC-ODBC Bridge Driver distributed by Sun is sun.jdbc.odbc.JdbcOdbcDriver
and this is what they write about it:
Note that the bridge driver included in the Java Platform Standard Edition (Java SE) 6 is appropriate only for experimental use or when no other driver is available.
And if this is not enough, here is what Ted Neward writes in Item 49 of Effective Enterprise Java:
(...) the JDBC-ODBC driver is an unsupported, bug-ridden 1.0 driver that is incredibly slow and is rumored to leak memory in some ODBC driver configurations (...)
Things may be a bit better with the Microsoft one (which is com.ms.jdbc.odbc.JdbcOdbcDriver
) but I wouldn't expect a miracle.
So, if this is for a corporate application, maybe consider spending a few dollars for a commercial type 4 JDBC Driver. See this previous answer for some options.
It doesn't look like you need a MS driver at all. Just use a sun ODBC driver. Look at the article here.
I've never needed it, but I've heard good things about this one: http://jackcess.sourceforge.net/
You can use UcanAccess: http://ucanaccess.sourceforge.net/site.html It is a good replacement for the ODBC driver since Java 8
精彩评论