0
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        //System.out.println("Driver loaded");
        String url = "jdbc:ucanaccess://"+path;
        con = (Connection) DriverManager.getConnection(url);

I don't get any error or bugs & doesn't connect!?

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
DevBia
  • 1
  • 3
  • Your question is **vague**. There might be situation in setting up the **dsn** or many other things. You must catch up this link:http://www.java2s.com/Code/Java/Database-SQL-JDBC/SimpleexampleofJDBCODBCfunctionality.htm and this link:https://www.javatpoint.com/connectivity-with-access-without-dsn for more details –  Aug 12 '17 at 07:18
  • UCanAccess is not an ODBC based driver; your question is unclear. – Mark Rotteveel Aug 12 '17 at 14:46

3 Answers3

0

There is an example how to use it: http://www.javacoffeebreak.com/articles/jdbc/

The driver was removed in Oracle JRE 8, so use Java version 7 or earlier.

Agustus
  • 634
  • 1
  • 7
  • 24
0

UCanAccess is a JDBC driver in its own right. It does not use ODBC, so

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

is not applicable. That is the JDBC-ODBC Bridge, which was removed from Java 8.

For details on how to use UCanAccess, see this answer.

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
-1
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");  
String url = "jdbc:ucanaccess://"+path;
Connection c=DriverManager.getConnection(url);  
Statement st=c.createStatement();   
ResultSet rs=st.executeQuery("select * from table");  
Jay
  • 308
  • 2
  • 10