21.1.Simple MVC Using Database

Sunday, January 23, 2011 Posted by Sudarsan
In this post you are going to learn how JSPs and Servlets interact with Database.

Have look at the fallowing images to develop a Simple MVC using Database, so lets get Started !

Create the Directory Structure for the project as I shown below in the image

Director Structure


After creating the Directory Structure, design the JSPs and write the code inside Java Classes as shown in the below pictures !!

index.jsp


add.jsp


view.jsp


edit.jsp


Department.java



Database.java


AddDeptServlet.java


DelDeptServlet.java


UpdateDeptServlet.java


FinalUpdateDeptServlet.java



Then create table "DEPT" in "Java DB" database and add "derbyclient.jar" file for the project.

Now, execute the Project and observe the output in the browser.
Labels:
  1. I am not able to view adddeptservlet.There are many others too which i am not able to view the coding

  2. These are the images, plz download the Image and zoom it, so that u will see.Mean while I will try to upload the code as well.

Post a Comment