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.
-
Spring framework comes to mind.
-
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
-
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.
-
You can also refer in some ORM tools - like Hibernate, TopLink, Apache Cayenne etc. Sometimes ORM is very useful.
-
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.
0 comments:
Post a Comment