Spring MVC 3 CRUD example with MyBatis 3

CRUD

In this tutorial series, we will go through a journey of learning stuffs that will make us comfortable with integrating MyBatis 3 and Spring MVC 3 to perform a CRUD operation on database.

Example Project description:

We have a domain object called User with four properties name, standard, age and sex. We will perform CRUD operation from a web page which will be like the following :

Spring MVC and MyBatis 3 Integration - User Form

Spring MVC and MyBatis 3 Integration - User Form

The registration form will provide a way to create new user or modify existing user. The bellow table will show all users present in database. Clicking on the table row, the data corresponding to the clicked row will be available for updation :

Spring MVC and MyBatis 3 Integration - User Form with update data

Spring MVC and MyBatis 3 Integration - User Form with update data

 

On this state if you change any value of form and click on “Save Changes” button, it will be reflected to bellow table row data and also database values.

Spring MVC and MyBatis 3 Integration - User Form to update data

Spring MVC and MyBatis 3 Integration - User Form to update data

I have changed the value of standard from “MCA” to “B.Tech” and then click on “Save Changes” button and get following page:

Spring MVC and MyBatis 3 Integration - Data table with updated data

Spring MVC and MyBatis 3 Integration - Data table with updated data

 

In this series, we will have following session to complete our full example:

You can download the source code and war file from following links:

Source (Eclipse Project without jars) :Download

War (With jars) :Download

Related Posts:

Leave a Comment Cancel reply

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>