0

I have read about million solutions, none seemed to work. I have the following piece of code :

//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
//Connection dbConnection = DriverManager.getConnection("jdbc:ucana­ccess://dbName");
Connection dbConnection=DriverManager.getConnection("jdbc:ucanaccess://C:/Users/Eshel/Desktop/workspace2/final_project/NZDB1.mdb");
//Connection dbConnection = DriverManager.getConnection("jdbc:odbc:;DRIVER=Microsoft Access Driver (*.mdb, *.accdb); DBQ=./" + dbName, "", "");
System.out.println("Conection established=" + dbConnection);

the lines which are commented out are all kind of things I have tried. Keep getting "Source not found" and classLoader exceptions. For example when I try to use the ucanaccess class I get "The source attachment does not contain the source for the file UcanaccessDriver.class" Even added entries in System DNS, nothing works so far ... Any suggestions ?

Thanks a lot !

UserED
  • 33
  • 9
  • Are you using an IDE (Eclipse, NetBeans, IDEA, ...)? If so, which one? – Gord Thompson May 16 '16 at 12:55
  • Okay, so have you tried following the instructions [here](http://stackoverflow.com/a/21955257/2144390)? – Gord Thompson May 16 '16 at 13:43
  • Only tried the second option, have all the files specified there, that's why I have the ucanaccess in the code ... going to try the first one now – UserED May 16 '16 at 13:46
  • Ok, tried to install maven (not sure I did it right), and I am using the same ucanaccess file. I keep get the "The source attachment does not contain the source for the file UcanaccessDriver.class" error ... is there any problem with specific versions of ucanaccess ? or something like that ? – UserED May 16 '16 at 14:12
  • **(1)** Double-check the "Libraries" tab on the "Java Build Path" pane of the project Properties dialog to ensure that it looks like [this](http://i.stack.imgur.com/ZP3X3.png). **(2)** Click the little triangle to the left of each of the five (5) JAR entries and make sure that "Source attachment: (none)" appears. If there is something there then click the "Remove" button. – Gord Thompson May 16 '16 at 15:17
  • Does it matter if I have javaSE-1.7 or a newer version such as jre1.8.0_91 ? – UserED May 16 '16 at 15:33
  • so it still doesn't work ... does it matter the versions of the different files ? (jackcess etc ... ) – UserED May 16 '16 at 15:50
  • Hey Gord, do you have anything else I can try ? – UserED May 17 '16 at 12:19
  • re: versions - UCanAccess is under active development, so you should always be using the latest stable release (currently 3.0.5). The required versions of all dependencies (Jackcess, HSQLDB, etc.), are always included in the `lib/` folder of the UCanAccess distribution ("UCanAccess-x.y.z-bin.zip"). – Gord Thompson May 17 '16 at 14:11
  • Got it working !!! downloaded the current version + downloaded the recent JDK ( had JRE before ). Thanks A LOT Gord – UserED May 20 '16 at 06:55

0 Answers0