Accessing a database

In the previous chapter, we already saw how to write the code to access databases. Here, we will be using the H2 database engine again, as it doesn't require you to do anything extra in order to execute the example. The related pom.xml entry is as follows:

<dependency>    <groupId>com.h2database</groupId>    <artifactId>h2</artifactId>    <version>1.4.197</version></dependency>

For sbt, the build.sbt file will need to have the following:

"com.h2database" % "h2" % "1.4.197"

Get Scala Design Patterns - Second Edition 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.