Read this post from start

Creating a database driven application

Let’s create a complete CRUD (create, read, update, delete) sample project with Eclipse + Tomcat + Maven

1.  Create a new maven web project as discussed in part 1
Group Id    :    com.ap
Artifact Id  :    com.ap.crud

2.  Add following dependencies in pom.xml


3.  If you don’t see the src/main/java folder in the project, right click on src/main folder and create a new folder with name java

4.  Now right click on src/main/java folder, create new package named com.ap.crud.servlets
Similary create following packages:
com.ap.crud.entity              ( for classes corresponding to tables )
com.ap.crud.dao                ( for database operations )                ( for project data )

You can download the whole project from the link below
Download Complete Project