I have created an MS Access database and assigned a DSN to it. I want to access it through my Java application.
This is what I am doing:
public class         
        
add these dependecies to your .pom file:
  org.hsqldb 
  hsqldb 
  2.5.0 
  test 
 
  com.healthmarketscience.jackcess 
  jackcess-encrypt 
  3.0.0 
 
  net.sf.ucanaccess 
  ucanaccess 
  5.0.0 
 
  org.apache.commons 
  commons-lang3 
  3.9 
 
  commons-logging 
  commons-logging 
  1.2 
 
and add to your code to call a driver:
Connection conn = DriverManager.getConnection("jdbc:ucanaccess://{file_location}/{accessdb_file_name.mdb};memory=false");