I am rather new to writing applications that interact with databases, and I’m curious about a project I’m working on. I have to write a very simple web app which is going to be displaying metric data based off a handful of various queries (probably not over 15) to various database tables. Based on my own research, Spring JDBC Template seemed like a good technology to go with based on the rather simplistic nature of my project. Every example I see for using it though seems to involve the use of the DAO pattern. I was under the assumption that usage of the DAO pattern wouldn’t be necessary for what I’m doing, but it seems extremely pervasive in the examples, so perhaps I’m mistaken.
What criteria would be used to evaluate whether I should be implementing a DAO pattern with Spring JDBC Template for my project?
3
No matter how small your project, maybe it is advisable to use DAOs and when it comes to a database query it is a good idea to use Hibernate to access the database contents. Then all you would need is to autowire the sessionfactory so that you can use it on your controller.
1