Persistence is simply the matter of saving data permanently, so it can be obtained later on. Simply saving data to a database would be the act of persistence. The idea behind Hibernate is that it makes saving, or persisting your data, easier.
Other ways include SQL, straight JDBC, TopLink, EJB Entity Beans, JDO, etc.
Originally posted by pradeep singh: Hi Why we cant use simple jdbc for storing data into database instead of Hibernate?What are benefit of using one on other?
Who said that you CAN'T use JDBC? You can do that if you want. Each solution has its own pros and cons. The problems of using core JDBC are several. Take the following for instance:
A lot of unneeded legacy code like opening and closing connections that you have to handle yourself
Database portability is a problem, since each vendor has his own SQL dialect
Developers have to deal with both relational and object oriented data models, and transform from one to the other themselves
A lot of bugs and performance issues can arise from forgetting to close connections, statements and result sets.
Of course projects like Spring's JDBCTemplate can help solve the first and the last problems mentioned here, but using ORM solves the other two. Of course ORM has its own disadvantages, like having to know how to optimize the generated queries yourself through configurations, and stuff like that. It all depends on what you see useful for your project. For enterprise level projects, I always recommend using ORM together with Spring to make use of their ready made templates.
searching and sorting is fast Work with large amounts of data Work with groups of data Joining, aggregating Sharing across multiple users and multiple locations Concurrency (Transactions) Support for multiple applications Consistent Integrity Constraints at different levels Transaction isolation
Watchya got in that poodle gun? Anything for me? Or this tiny ad?