Hibernate / Hibernate interview questions
Benefits of hibernate over JDBC?
- Hibernate is database independent while in case of JDBC, developer has to write database specific queries.
- In case of Hibernate developer doesn't need to be an expert of writing complex queries as HQL simplifies query writing process while in case of JDBC, its job of developer to write and tune queries.
- In Hibernate, Criteria Query takes care of Query Tuning. In case of JDBC you need to tune your queries.
- No need to create any connection pool in case of Hibernate. You can use c3p0. In case of JDBC you need to write your own connection pool.
- Automatic primary key generation.
- Performance benefits like Lazy initialization, Outer join fetching, Batch fetching.
More Related questions...