It has lot of advantages few advantages are1) ORM2) Reduced code ,
No need to write JDBC coding each and every time , it consist one Hibernate.cfg.xml file it contains mapping for database connectivity, we can use it any where using hibernate session .So the database connectivity is more easy3)using entities for table representation4)NamedQuery5)Open Source
If you are going to build your application based on Object Oriented Design, then you can consider hibernate. Because you can directly save an object as a table(Object Relational Mapping) in database without much overheads encounters in JDBC.
The main use of using hibernate in java application is that Hibernate is databace indepnedent. by which u can easily change from database to another database. by which flexibility in ur application will be maintained
If you are designing the database schema and your domain objects afresh.
You envision that your domain objects and your schema will be in sync, for example an automobile vendor application where your vehicle objects are likely to be close to your table structures. Just an example.
You really want to use an ORM and tie your objects closely to schema.
Want to use a ORM framework to handle connections etc.
من قبل
Zabeer Sultan , Senior Technical Lead , Happiestminds
If you want to make your java application Database neutral, you should go for Hibernate so that it can support any Database with minimum configuration changes if you want migrate from one DB to another.
من قبل
Rajeev Shaw , Software Engineer , Gowdanar Technologies Pvt. Ltd.
Hibernate is used to make your Database communication easier. You don't have to worry about all the boilerplate codes that you go on writing in your JDBC connection. But, to understand the Hibernate properly, I will tell you to know the JDBC first. Then only you will be able to make the difference between them and advantages you are getting in Hibernate.