Tutorial :JDBC DAO - any good reference implementation?



Question:

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

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

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


Solution:1

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

Further Information at:

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


Solution:2

Spring framework comes to mind.


Solution:3

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.


Solution:4

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


Solution:5

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.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »