1

I am trying to connect to a local .mdb file using Java 8. So far I have used UCanAccess's libraries but not all features are supported.

In Java 8 "JDBC/ODBC was scrapped"... So my question is:

What is the new method to connect to .mdb files (without UCanAccess)?

Gord Thompson
  • 98,607
  • 26
  • 164
  • 342
Kyle
  • 180
  • 1
  • 1
  • 10
  • The main reason I posed this question is because of `net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::3.0.0 feature not supported` – Kyle Aug 22 '15 at 15:33
  • Check out http://stackoverflow.com/questions/21955256/manipulating-an-access-database-from-java-without-odbc. This may help. – Danny Daglas Aug 22 '15 at 15:43
  • 1
    What's exactly the sql that caused the feature not supported exception? In many cases there is another way with ucanaccess (but not without it) – jamadei Aug 22 '15 at 16:19
  • @jamadei Select statement with TOP 1, syntax was not problem – Kyle Aug 24 '15 at 09:20
  • (cc: @jamadei) I just tested with UCanAccess 3.0.0 and `SELECT TOP 1 id FROM tablename ORDER BY id` worked fine for me. `TOP 1 PERCENT` is not supported by UCanAccess (not yet, at least), but `TOP 1` certainly is. – Gord Thompson Aug 24 '15 at 13:36
  • Select Top 1 * from table, as Gord said, is supported by ucanaccess. Not sure about the firm foundations of this thread. – jamadei Aug 24 '15 at 17:20
  • Should I vote to delete thread since original problem was not thread's topic? Apologies to Gord and Jamadei, but this thread does not contribute any longer to other users. – Kyle Aug 25 '15 at 09:02

1 Answers1

2

If you really don't want to use UCanAccess then you'll probably have to buy a third-party library

  • to replace the JDBC-ODBC Bridge that was removed from Java 8, or

  • to provide direct JDBC connectivity to the Access database.

However, as Marco indicates in his comment to the question, there could very well be UCanAccess (or HSQLDB) workarounds for your "feature not supported" issues if you care to give us a hint as to what they are.

Gord Thompson
  • 98,607
  • 26
  • 164
  • 342
  • So how do people connect to DB files now? I know java8 removed the specific support, but is there no other way now? Where is the "revolution of DB access" that I heard of? I honestly think switching back to java 7 might be a better option until v9 (if that changes anything) – Kyle Aug 24 '15 at 09:23
  • *"So how do people connect to DB files now?"* They usually connect from Java 8 using a JDBC driver. *"Where is the 'revolution of DB access' that I heard of?"* What do you mean? Can you cite a reference or two? *"I honestly think switching back to java 7 might be a better option until v9 (if that changes anything)"* The JDBC-ODBC Bridge was never really supported and was finally removed from Java 8. The chances of it being re-introduced in Java 9 are very slim indeed. – Gord Thompson Aug 24 '15 at 13:45
  • I think I'll leave it at that then, i misunderstood the application of J/ODBC. Thank you for your time – Kyle Aug 25 '15 at 08:58