MVC in action part2: DAO + Bean Classes
So far I have shown how to write a simple web application using jsp servlets while connecting to sql db. Now I am going to go deep down of it, more readable and understandable way, not just MVC (Model - business logic class in logical tier or data tier, View- presentation layer jsp or html file, Controller- again logical tier routing class such as servlet). Data tier contains db. In regular scenarios, other than directly fetching data from db, you passed them or access them through data structures such as list, vectors, map or etc, more convenient. Using bean classes (getters and setters) known as entity classes (depend on logic you implement) is more appropriate while data interchanging takes place from db. Below example shows how you can implement simple web application using MVC architecture plus DAOs and Bean classes using sql database. First create dynamic web application project in eclipse. I use eclipse 3.7 Idigo. Then create jsp page in <%@ page language="java&