You need these lib in order to build java action base on RDD programming.
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.SparkConf;
According to the documentation, you should be able to connect to spark using Jdbc. More info on this here
I think your best bet is to use the database connector to connect to spark sql.
Hi , Are you able to Integrate Apache Spark with mendix ? Can you please let me know . Even in my project , i am planning to use database connector for Hadoop data lake along with Apache Spark , so if with java action are you able to integrate Spark with Mendix ?