In DAO you can separate your database access logic from your controller logic, for example.
In the case of a product registration system we would have the following classes: Product, Product, Sessionfactory/Entityfactory.
In Productodao is where we will have the logic of access to bank, the connection of the bank can be made from JPA or even Hibernate, speaking in a very simple way, JPA makes the connection for you, using under the cloths the Hibernate.
Then in your DAO you will have a call from a Factory of connection with the bank, can be a Sessionfactory in the case of Hibernate or an Entityfactory in the case of JPA.
JDBC is basically the connection of java to the database, formerly before technologies like Hibernate and JPA we needed to have a JDBC class where we would make all our connection logic and database calls (selects, Inserts, updates, Deletes), using these technologies, have already won these semi logics ready, just call them, as for example the persist(data) of JPA, which will make an entrance in the bank for you.
The Servlets classes allow you to create dynamic web pages.
The name Servlet comes from the idea of a small server whose goal is to receive HTTP calls, process them and return a response to the client. Each Servlet is therefore a Java object that takes such requests (request) and produces something (Response), such as a dynamically generated HTML page.
And Tomcat is a software that you use to upload your server and deploy your project on it, it is a container of Servlets.
You can follow Caelum’s free courses on web development:
Caelum Java web development
If you want to go deeper, you can do this on Web development with vraptor:
Caelum Agile web development with vraptor
Just remembering that my explanation was shallow! But I hope I helped =D
Gosh, thank you very much!
– Ronaldo Maia