JDBC DAO - 任何好的参考实现?

时间:2022-02-01 16:14:41

Can anyone point me to a well written DAO using JDBC, that covers all the exceptions a DAO should handle.

任何人都可以指出我使用JDBC编写的DAO,它涵盖了DAO应该处理的所有异常。

I looked at some samples at java.sun.com, their blue prints but there is a lot of theory and less code.

我在java.sun.com看了一些样本,他们的蓝图,但是有很多理论和更少的代码。

Looking through Spring DAO source code will be enlightening but that's way too complicated for me.

浏览Spring DAO源代码将具有启发性,但这对我来说太复杂了。

5 个解决方案

#1


8  

Spring JdbcTemplate provides most plumbing you will need to implement a JDBC DAO.

Spring JdbcTemplate提供了实现JDBC DAO所需的大多数管道。

Further Information at:

更多信息:

http://static.springframework.org/spring/docs/2.0.x/reference/jdbc.html

http://static.springframework.org/spring/docs/2.0.x/reference/jdbc.html

#2


0  

Spring framework comes to mind.

想到了Spring框架。

#3


0  

If you are looking for a more simple implementation, you should take a look here. However, a more complex sample is found here.

如果您正在寻找更简单的实现,您应该看看这里。但是,这里可以找到更复杂的样本。

Hope it helps.

希望能帮助到你。

#4


0  

You can also refer in some ORM tools - like Hibernate, TopLink, Apache Cayenne etc. Sometimes ORM is very useful.

你也可以参考一些ORM工具 - 比如Hibernate,TopLink,Apache Cayenne等。有时候ORM非常有用。

#5


0  

An example can be found at http://daoexamples.sourceforge.net/. Looking through Google's code search, I found this that has some DAOs. You may also want to do some research on generic DAOs, start here and here.

可以在http://daoexamples.sourceforge.net/找到一个例子。通过谷歌的代码搜索,我发现这有一些DAO。您可能还想对通用DAO进行一些研究,从这里和这里开始。

#1


8  

Spring JdbcTemplate provides most plumbing you will need to implement a JDBC DAO.

Spring JdbcTemplate提供了实现JDBC DAO所需的大多数管道。

Further Information at:

更多信息:

http://static.springframework.org/spring/docs/2.0.x/reference/jdbc.html

http://static.springframework.org/spring/docs/2.0.x/reference/jdbc.html

#2


0  

Spring framework comes to mind.

想到了Spring框架。

#3


0  

If you are looking for a more simple implementation, you should take a look here. However, a more complex sample is found here.

如果您正在寻找更简单的实现,您应该看看这里。但是,这里可以找到更复杂的样本。

Hope it helps.

希望能帮助到你。

#4


0  

You can also refer in some ORM tools - like Hibernate, TopLink, Apache Cayenne etc. Sometimes ORM is very useful.

你也可以参考一些ORM工具 - 比如Hibernate,TopLink,Apache Cayenne等。有时候ORM非常有用。

#5


0  

An example can be found at http://daoexamples.sourceforge.net/. Looking through Google's code search, I found this that has some DAOs. You may also want to do some research on generic DAOs, start here and here.

可以在http://daoexamples.sourceforge.net/找到一个例子。通过谷歌的代码搜索,我发现这有一些DAO。您可能还想对通用DAO进行一些研究,从这里和这里开始。