Spring MVC With JdbcTemplate Example
Spring MVC With JdbcTemplate Example
Spring MVC With JdbcTemplate Example
introductory tutorial for the basics of JdbcTemplate, see: Spring JDBC Template Simple
Example. This tutorial goes further by demonstrating how to integrate JdbcTemplate in a
Spring MVC application. The sample application in this tutorial manages a contact list that
looks like this:
Java 7
Eclipse Kepler
JSTL 1.2
The following XML section in pom.xmlfile is for adding dependencies configuration to the
project:
1 <properties>
<java.version>1.7</java.version>
2 <spring.version>4.0.3.RELEASE</spring.version>
3 <cglib.version>2.2.2</cglib.version>
4 </properties>
5
6 <dependencies>
7 <!-- Spring core & mvc -->
<dependency>
8 <groupId>org.springframework</groupId>
9 <artifactId>spring-context</artifactId>
10 <version>${spring.version}</version>
11 </dependency>
12
13 <dependency>
<groupId>org.springframework</groupId>
14 <artifactId>spring-webmvc</artifactId>
15 <version>${spring.version}</version>
16 </dependency>
17 <dependency>
<groupId>org.springframework</groupId>
18 <artifactId>spring-orm</artifactId>
19 <version>${spring.version}</version>
20 <type>jar</type>
21 <scope>compile</scope>
22 </dependency>
23
<!-- CGLib for @Configuration -->
24 <dependency>
25 <groupId>cglib</groupId>
26 <artifactId>cglib-nodep</artifactId>
27 <version>${cglib.version}</version>
28 <scope>runtime</scope>
</dependency>
29
30
31 <!-- Servlet Spec -->
32 <dependency>
33 <groupId>javax.servlet</groupId>
34 <artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
35 <scope>provided</scope>
36 </dependency>
37 <dependency>
38 <groupId>javax.servlet.jsp</groupId>
39 <artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
40 <scope>provided</scope>
41 </dependency>
42 <dependency>
43 <groupId>jstl</groupId>
<artifactId>jstl</artifactId>
44
<version>1.2</version>
45 </dependency>
46
47 </dependencies>
48
49
50
51
52
53
54
55
56