EJB design: Pattern to manage tables?? DAO??

  1. Pattern to manage tables?? DAO?? (8 messages)

    I'm looking for some pattern that can encapsulate all the access to a RDMBS tables, now i'm using DAO with and abstract factory but this mean that if I want to persists some object the implementation of this DAO needs to know the exactly SQL string to manage this.. So there is some pattern that could be more flexible in the way that only I call with the parameters, the type of operation (insert, update, delete,..) and the name of the table and it can made the operation???

    Is this a problem of JDBC and not a pattern?? is this a hard coded library?? some ideas to manage this??

    Thanks in advance

    Threaded Messages (8)

  2. http://jinx.swiki.net/282




    see pages 390 to 407 in the book "Core J2EE Patterns" - http://www.phptr.com/corej2eepatterns









    read Chapter 4 in "Enterprise JavaBeans Component Architecture: Designing and Coding Enterprise Applications" - http://www.asgteach.com/books/enterprise_java_beans.htm

    com.ibatis.db.dao package in http://sourceforge.net/projects/ibatisdb


    Benefits of DAO in a J2EE application: http://www.codefutures.com/firestorm/benefits/



    presentation from JavaOne 2001: http://java.sun.com/javaone/javaone2001/pdfs/2399.pdf

    DAO discussion: http://www.mail-archive.com/users at avalon dot apache dot org/msg00164.html
  3. Thanks for your soon replay, I read somthing about you send me and desing a solution based on a Abstract Factory pattern that factory's some command like Selec Insert, etc. so in this way I can do the effect, No wI 'm try to generate another Abstract Factory that create for me the particualr DAO over the tables.

    Thnaks Again
  4. Hibernate[ Go to top ]

    Use Hibernate (hibernate.sourceforge.net) instead of straight JDBC.
  5. You can follow the command patterns. I believe this is discussed in the EJB desgin patterns book available at this website. Basically your class implements an interface with an execute method and maybe some method to set your parameters etc.
  6. SpringFramework, JDBC[ Go to top ]

    If you are looking for a JDBC abstraction layer, look at the
    Spring Framework, http://www.springframework.org/

    If you want to see example DAO code, visit
  7. Re: SpringFramework, JDBC[ Go to top ]

    you can check spring tutorial at http://www.techfaq360.com/tutorial/spring/spring.jsp
  8. Re: SpringFramework, JDBC[ Go to top ]

    Hi, Some of good questions on Hibernate at http://hibernate-questions.weebly.com Thanks.
  9. hibernate help[ Go to top ]

    hi i am new to hibernate and also discussion of theserverside. Can anyone pls help me to solve my doubts? Actully I have to develop a standalone application, so hibernate is a good choice or not for that? Thanks!