title: Scala to connect in HIVE via JDBC - HDP
body: <p>i'm trying to connect in HIVE (in sandbox of Hortonworks) and i'm receving the message below:</p>
  
  <p>Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:hive2://sandbox.hortonworks.com:10000/default</p>
  
  <p>Maven dependencies:</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;                                                      
          &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;                       
          &lt;artifactId&gt;spark-core_2.10&lt;/artifactId&gt;                  
          &lt;version&gt;${spark.version}&lt;/version&gt;                       
          &lt;scope&gt;provided&lt;/scope&gt;                                   
      &lt;/dependency&gt;                                                     
      &lt;dependency&gt;                                                      
          &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;                       
          &lt;artifactId&gt;spark-sql_2.10&lt;/artifactId&gt;                   
          &lt;version&gt;${spark.version}&lt;/version&gt;                       
          &lt;scope&gt;provided&lt;/scope&gt;                                   
      &lt;/dependency&gt;                                                     
      &lt;dependency&gt;                                                      
          &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;                       
          &lt;artifactId&gt;spark-hive_2.10&lt;/artifactId&gt;                  
          &lt;version&gt;${spark.version}&lt;/version&gt;                       
          &lt;scope&gt;provided&lt;/scope&gt;                                   
      &lt;/dependency&gt;                                                     
  &lt;/dependencies&gt;  
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>   // **** SetMaster is Local only to test *****                                  
      // Set context                                                                
      val sparkConf = new SparkConf().setAppName("process").setMaster("local")      
      val sc = new SparkContext(sparkConf)                                          
      val hiveContext = new HiveContext(sc)                                         
  
      // Set HDFS                                                                   
      System.setProperty("HADOOP_USER_NAME", "hdfs")                                
      val hdfsconf = SparkHadoopUtil.get.newConfiguration(sc.getConf)               
      hdfsconf.set("fs.defaultFS", "hdfs://sandbox.hortonworks.com:8020")           
      val hdfs = FileSystem.get(hdfsconf)                                           
  
      // Set Hive Connector                                                         
      val url = "jdbc:hive2://sandbox.hortonworks.com:10000/default"                
      val user = "username"                                                         
      val password = "password"                                                     
  
      hiveContext.read.format("jdbc").options(Map("url" -&gt; url,                     
      "user" -&gt; user,                                                               
      "password" -&gt; password,                                                       
      "dbtable" -&gt; "tablename")).load()                 
  </code></pre>