Adding MySQL and PostgreSQL connectors to Apache Spark environment
<p>In my program I need both MySQL and PostgreSQL connectors. 
I have downloaded both connectors and I can run them one by one; both when I tried to run both connectors I failed.</p>

<p>I run only MySQL connector with this command:</p>

<pre><code>./spark-submit --driver-class-path /home/mysql-connector-java-5.1.37-bin.jar --class learner.run.package --master local[8] --executor-memory 8G  /home/project_2.10-1.0.jar
</code></pre>

<p>And when I wanted to add PostgreSQL connector to my classpath I rearranged my command with <code>--jars</code> option:</p>

<pre><code>./spark-submit --master local[8] --executor-memory 8G --class learner.run.package --driver-class-path --jars  /home/postgresql-9.4.1208.jre6.jar /home/mysql-connector-java-5.1.37-bin.jar /home/merve/Desktop/v1/target/scala-2.10/project_2.10-1.0.jar
</code></pre>

<p>But it gave me this error :</p>

<pre><code>java.lang.ClassNotFoundException: learner.run.package
</code></pre>

<p>I also tried to adding these connectors to spark class path by adding the following line to spark-env.sh :</p>

<pre><code>SPARK_CLASSPATH= /home/mysql-connector-java-5.1.37-bin.jar
</code></pre>

<p>But it could not find MySQL connector. </p>

<p>And finally I tried <code>.setJars()</code> option, but it did not work too.</p>

<p>How can I run spark-submit with these 2 connectors or how can I add these connectors to class-path?</p>