Scala and JDBC Database Access

In this chapter we will primarily look at how Scala can use a database connectivity API referred to as JDBC. Strictly speaking this is available to Scala when run on a JVM due to its relationship to the byte code environment of the JVM. Officially JDBC is not an acronym, however to all intents and purposes it stands for Java DataBase Connectivity. This is the mechanism by which relational databases are accessed in Java. As Scala runs in the same environment as Java Scala programs also have access to JDBC. At the time of writing it is the simplest and most stable approach to database access in Scala; however it is not the only approach and we will look at some of the more Scalaesque approaches in the next chapter.