title: Apache Spark - Unable to read data from MS Access tables into Spark dataset
body: <p>When I try to read .accdb data into my spark dataset I am getting </p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class net.ucanaccess.jdbc.UcanaccessDriver
  at java.base/java.lang.Class.forName0(Native Method)
  at java.base/java.lang.Class.forName(Class.java:398)
  at java.sql/java.sql.DriverManager.isDriverAllowed(DriverManager.java:555)
  at java.sql/java.sql.DriverManager.isDriverAllowed(DriverManager.java:547)
  at java.sql/java.sql.DriverManager.getDriver(DriverManager.java:280)
  at org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions.$anonfun$driverClass$2(JDBCOptions.scala:105)
  at scala.Option.getOrElse(Option.scala:121)
  at org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions.&lt;init&gt;(JDBCOptions.scala:105)
  at org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions.&lt;init&gt;(JDBCOptions.scala:35)
  at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:32)
  at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:318)
  at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:223)
  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211)
  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:167)
  at business.extract.DataExtractorImpl.loadFromAccessTable(DataExtractorImpl.java:62)
  at application.Orchestrator.initializeJob(Orchestrator.java:52)
  at application.ETLEngine.main(ETLEngine.java:15)
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>//DataExtractorImpl.java
      public Dataset&lt;Row&gt; loadFromAccessTable(String url, String tableName) throws IOException, CustomValidationException {
      return ETLContext.getETLContext().getSession()
              .read()
              .format("jdbc")
              .option("URL", "jdbc:ucanaccess://C:/Users/KE926ES/Documents/db/Creditcard_default.accdb")
              .option("dbtable", "CC_SOURCE_1")
              .load();
  </code></pre>
  
  <p>I have the following jars</p>
  
  <ul>
  <li>ucanaccess-5.0.0.jar</li>
  <li>jackcess-3.0.1.jar</li>
  <li>commons-lang3-3.10.jar</li>
  <li>commons-logging-1.2.jar</li>
  </ul>
  
  <p>I also tried adding the following to the options list </p>
  
  <pre><code>.option("driver", "net.ucanaccess.jdbc.UcanaccessDriver")
  </code></pre>