title: Spark : java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/postgres
body: <p>In my spark application, I am trying to connect to local Postgres database using following line:</p>
  
  <pre><code>val conn = DriverManager.getConnection("jdbc:postgresql://localhost/postgres", "postgres", "*Qwerty#")
  </code></pre>
  
  <p>Postgres server is running on port 5432 (default). I have also tried including the port.
  I have also tried <code>Class.forName("org.postgresql.Driver")</code> but it throws ClassNotFoundException. I have made sure that the driver is in the ClassPath.</p>
  
  <p>I am running spark in the local mode.</p>
  
  <p>But I am getting the above exception.</p>
  
  <p>I have included the jdbc driver via <code>sbt</code> as mentioned here :
  <a href="https://mvnrepository.com/artifact/org.postgresql/postgresql/42.2.2" rel="nofollow noreferrer">https://mvnrepository.com/artifact/org.postgresql/postgresql/42.2.2</a></p>