From the course: Scala Essential Training for Data Science

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Connecting to PostgreSQL

Connecting to PostgreSQL

- Now we are missing a component of software that we actually need to allow Scala to communicate with the Postgres database. And that component is a JDBC driver for our database. Now, Postgres offers a JDBC driver. So what I've done is I've opened my browser and I've navigated to the website jdbc.postgresql.org/download. And that's where we can download the JAR files, which contain the JDBC driver, which we need to allow us to query the Postgres database from Scala. So I'm simply going to download the latest version, which in my case happens to be 42.7.5, that'll download a JDBC driver. And this places the driver into my downloads directory. Now, if I were in a production environment or a development environment that I was going to be doing a lot of development in, I would simply move that JAR file into maybe my home directory under a lib or a library subdirectory. But I'm just doing some demonstration purposes here. So I'm just going to leave the JAR file there and I'll show you how…

Contents