My question just simple : what are the main differences between Spring jdbcTemplate and Hibernate ? what are the main reasons we should take into account for using one or the other ?
Thanks
My question just simple : what are the main differences between Spring jdbcTemplate and Hibernate ? what are the main reasons we should take into account for using one or the other ?
Thanks
Hibernate is a really huge solution with data persistence and ORM including JPA implementation. Also, there are defined many ways how to manage entities in Hibernate, how to persist, transactions, etc. In hibernate you can use SQL, HQL or java annotations. JDBC template is just a simple tool that helps you to manage SQL queries and transactions. It is probably better described as a JDBC wrapper or helper. If you prefer managing database queries (SQL) yourself or if you are a beginner, using Spring JdbcTemplate will help you understand how it works. Even if you are working on a bigger application, think about using Hibernate. Just be wary of the learning curve of Hibernate.
It all depends. If you doing a lot of mapping of domain objects to database tables, Hibernate is the solution you'd want to look at. If you are writing a reporting tool that does lots of complicated joins / PL-SQL, look into Spring JDBC Templates.