0

I want to establish a JDBC connection to MS Access with Ucanaccess. The application, where the connection should be built in, runs with Java 7 and there is no chance to change to Java 8 right now. Ucanaccess 5.0.0 and 5.0.1 need Java 8, so they do not work for me.

Here is the error message:

EXEC*sqlconnect [1]=net.ucanaccess.jdbc.UcanaccessDriver [2]=DriverManager.getConnection("jdbc:ucanaccess://C:/temp/Wincan.mdb") Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: net/ucanaccess/jdbc/UcanaccessDriver : Unsupported major.minor version 52.0

Ucanaccess 4.0.4 doesn't work either, probably because it's compiled for Java 6. Here is the error message:

Error while connecting: sqlconnect:connect:No suitable driver found for DriverManager.getConnection("jdbc:ucanaccess://C:/temp/Wincan.mdb")

This is the Java, that is being installed: Java(TM) Platform SE 7 U45, Product version 7.0.450.18

Is there any chance to get a Ucanaccess-Version that runs with my Java version mentioned above?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • I don't know the answer, but could the fact that JDK 7 has not been getting any security updates for the last 3 years, and you are therefore exposing yourself to several vulnerabilities, encourage you to upgrade? – k314159 May 03 '22 at 11:32
  • The application I am working with is a geografic information system (sewage, water, gas, areas, trees ...) and runs with Oracle 11g and will be replaced in about a year. It is not developed by me and it doesn't run with JDK8. I have to export data out of this application into MS-Access in order to pass this data to other companies who do further work with software based on MS-Access. As soon as my old system is replaced, I won't have this problem anymore – GuenniMo May 03 '22 at 11:50
  • Excuse my bad english, I'm german and the last english lessons I had took place in 1986. – GuenniMo May 03 '22 at 11:55
  • Duplicate of [How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version](https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi) – user207421 May 03 '22 at 12:07
  • @user207421 that is not a duplicate. None of the answers to that question would be of any help for this question. The OP already knows what version of Java each version of the JDBC driver is for, and has already stated that they cannot upgrade their JRE. – k314159 May 03 '22 at 13:15
  • According to their [website](http://ucanaccess.sourceforge.net/site.html) you should be able to use UCanAccess 4.0.0 with any version of Java after 6. Make sure you have put the driver in your classpath. Check the "Dependencies" section of that page. – k314159 May 03 '22 at 13:21
  • I'm gonna try this. Thanks a lot. – GuenniMo May 03 '22 at 13:30
  • My problem is solved. The application I'm working with seems to have a problem with colons ("jdbc:ucanaccess:......"). Now I build the connection string with substrings. All neccesary colons are created by the ascii-code of a colon. "jdbc" + asc(58) + "ucanaccess" + asc(58) + "....." Many thanks to all who took care of my problem. – GuenniMo May 04 '22 at 08:55
  • That's an unusual cause! – k314159 May 04 '22 at 13:56

0 Answers0