May 2015
Intermediate to advanced
234 pages
4h 18m
English
In this recipe, we will connect to a MySQL or PostgreSQL database from a Spring application. To connect to another database system, go to http://www.oxygenxml.com/database_drivers.html to find the relevant dependencies, driver class, and URL type.
You need a MySQL or PostgreSQL database up and running.
Here are the steps to connect from a Spring application to an existing database:
pom.xml:<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>pom.xml:<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> ...
Read now
Unlock full access