JDBC works great if you have a large RDD that you want to persist in one go.
But if you are writing row by row you will need to implement your own batching algorithm and connection pooling to get any decent performance.
You could always use mapPartition to open one connection per partition.
Re:Announcing Apache Spark 1.4
by sixdimensional on Thursday June 11, 2015 @06:19PM
(#9702822)
Nice link. Spark jobs run Java code anyway, so why not write to JDBC with the results of processing. Makes perfect sense.
Then at the end instead of writing to HBase you can write JDBC to do the insert.