Working with Relational Databases

By virtue of running on the Java Virtual Machine, Clojure has access to any database that can be accessed via Java Database Connectivity (JDBC).[42] With it, we can easily access a large number of RDBMS databases, such as MySQL, SQL Server, PostgreSQL, and Oracle. Several libraries are available for working with these databases. Let’s take a quick look at our options.

The simplest library for dealing with relational databases is clojure.data.jdbc. When using this library you will have to write custom SQL for each type of database you intend to use. If you know you’re going to be using a particular database, such as MySQL or PostgreSQL, this will likely not be a problem for you. However, if you ever decide ...

Get Web Development with Clojure now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.