  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | JSP - A mailing list about Java Server Pages specification and reference | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Separating SQL from code | Separating SQL from code 2004-04-07 - By Huy Nguyen
Back You can use the mapping pattern i.e. mappingSQL.xml (which is configurable) and then use Factory class/es to do the mappingSQL.xml lookup to generate a mappingSQL object which would hold sql value.
Cheers! Huy
Jean-Christian Imbeault <jean-christian.imbeault@(protected)> wrote: Hi, I'm somewhat new to patterns and J2EE but I was wondering if someone could help with a question I have.
I'm wondering if there are any patterns of practices that document ways to extract SQL from code or that discuss if this is a good thing or not?
I have read the J2EE Patterns book and done a bit of research (especially on DAO) but can find anything that talks about a total separation of SQL from code. I am wondering is removing SQL from code (and possibly placing it in a properties file or such) might be a good way of putting all the SQL in one place to make changes (maintenance) easier.
The best I could find was this article which documents one approach but not the pros or cons:
http://www.javapractices.com/Topic105.cjp
Thanks!
Jean-Christian Imbeault
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
huy.nguyen
(t)+612 9271 3241 (e) d_huy_nguyen@(protected)
-- ---- ---- ---- ---- ---- ----- Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway - Enter today
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) <DIV>You can use the mapping pattern i.e. mappingSQL.xml (which is configurable ) and then use Factory class/es to do the mappingSQL.xml lookup to generate a mappingSQL object which would hold sql value.</DIV> <DIV><BR>Cheers!</DIV> <DIV>Huy</DIV> <DIV><BR><B><I>Jean-Christian Imbeault <jean-christian.imbeault@(protected) .COM></I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER -LEFT: #1010ff 2px solid">Hi, I'm somewhat new to patterns and J2EE but I was wondering if someone<BR>could help with a question I have.<BR><BR>I'm wondering if there are any patterns of practices that document ways to<BR>extract SQL from code or that discuss if this is a good thing or not?<BR><BR>I have read the J2EE Patterns book and done a bit of research (especially on<BR>DAO) but can find anything that talks about a total separation of SQL from<BR>code. I am wondering is removing SQL from code (and possibly placing it in a<BR>properties file or such) might be a good way of putting all the SQL in one<BR>place to make changes (maintenance) easier.<BR><BR>The best I could find was this article which documents one approach but not<BR>the pros or cons:<BR><BR>http:/ /www.javapractices.com/Topic105.cjp<BR><BR>Thanks!<BR><BR>Jean-Christian Imbeault<BR><BR>============================================================== ======<BR>Companion Site: http://www.corej2eepatterns.com<BR>J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns<BR>List Archive: http:/ /archives.java.sun.com/archives/j2eepatterns-interest.html<BR>Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)</BLOCKQUOTE><BR> <BR><P><FONT face=Verdana color=gray>huy.nguyen</FONT></P> <P><FONT size=1><FONT face=Verdana color=darkred>(t)<FONT color=#000000>+612 9271 3241</FONT> </FONT></FONT><FONT size=1><FONT face=Verdana color=darkred>(e ) </FONT></FONT><A href="mailto:d_huy_nguyen@(protected)"><FONT face=Verdana color =blue size=1>d_huy_nguyen@(protected)</FONT></A></P><p><hr size=1><font face=arial size=-1>Do you Yahoo!?<br> <a href="http://us.rd.yahoo.com/evt=23609/*http://promotions.yahoo.com/design _giveaway/static/index2.html">Yahoo! Small Business $15K Web Design Giveaway</a> - Enter today ==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|
 |