开发者

Java Framework for Database operations [closed]

开发者 https://www.devze.com 2023-03-02 11:37 出处:网络
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing
Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 9 years ago.

开发者_Go百科 Improve this question

At my work place, we use DAO pattern to hancle any sort of database operation. It hides bulky statements from programmer. Programmers need to write sql query and logic to handle output data. BaseDao handles all sort of operation and return output in required format.

I found that this class is not perfect. I added the code to control number of connections and to handle connection issues like slow connectivity, no connectivty, number of atttempts for connection etc.

But I would have to add more code to support advance feature of JDBC like providing/accessing binary data, Handling resultsets returned from SPs etc.

Is there any Java Framework or group of classes which can cover many of the database operations?

Please suggest.


I think that you are looking for Java Persistence API. It's a Java EE specification and Hibernate is the most popular implementation.


You could try Spring DAO instead. They have a nice template pattern for handling resultsets.


Or you can take another step step back away from JDBC and use Hibernate.


Spring Data JPA does even more abstraction than the other suggestions people have made. With that and Hibernate you don't even need to write queries unless it's a complex operation you need to perform.

0

精彩评论

暂无评论...
验证码 换一张
取 消