Reply
Highlighted
New Contributor
Posts: 1
Registered: ‎03-02-2016

spark sql "No suitable driver found for jdbc" error!

[ Edited ]

 

hi

 

cloudera CDH version : 5.4.8

spark version 1.3.0

spark standalond mode

java 1.8.xcc

 

 

spark error is

Exception in thread "main" org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 6, spark002): java.sql.SQLException: No suitable driver found for jdbc:tibero:thin:abcd/abcd@192.168.0.1:1234:ABCD

 

 

spark run command

spark-submit --class ab.abc.abcd.spark.batch.example.JavaMToRdb --conf spark.executor.extraClassPath=/home/hadoop/Devs/Libs/SPARK_PROJ/tibero5-jdbc.jar --driver-class-path /home/hadoop/Devs/Libs/SPARK_PROJ/tibero5-jdbc.jar --deploy-mode client --jars /home/hadoop/Devs/Libs/SPARK_PROJ/tibero5-jdbc.jar --master spark://spark002:7077 --executor-memory 10g --total-executor-cores 20 JavaMToRdb.jar

 

 

 

java code

String jdbcUrl = "jdbc:tibero:thin:abc/abc@ip:1234:abcd;
try {
Class.forName("com.tmax.tibero.jdbc.TbDriver").newInstance();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {

e.printStackTrace();
}

DataFrame schemaData = getSqlContext().createDataFrame(aaa, abcd.class);
schemaData.registerTempTable("abc_TEST");
schemaData.insertIntoJDBC(jdbcUrl, "abc_TEST", true); //url, table, overwrite

 

 

 

Similar errors

http://apache-spark-user-list.1001560.n3.nabble.com/spark1-3-1-using-mysql-error-td22643.html

 

 

 

Tell us a solution ....