Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Separating SQL from code

Separating SQL from code

2004-04-07       - By Umesh Singh

 Back
Reply:     1     2     3     4     5     6     7     8     9     10  

Hi You can use DAO with Properties file to keep the SQL configurable. We are
using SQL as Private String at class level in the DAO. You can use this
approach also so it is manageable.

Regards,
Umesh

-- --Original Message-- --
From: Jean-Christian Imbeault
[mailto:jean-christian.imbeault@(protected)]
Sent: 07 April 2004 10:26
To: J2EEPATTERNS-INTEREST@(protected)
Subject: Separating SQL from code


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)

====================================================================
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)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: Separating SQL from code</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Hi You can use DAO with Properties file to keep the SQL
configurable. We are using SQL as Private String at class level in the DAO. You
can use this approach also so it is manageable.</FONT></P>

<P><FONT SIZE=2>Regards,</FONT>
<BR><FONT SIZE=2>Umesh</FONT>
</P>

<P><FONT SIZE=2>-- --Original Message-- --</FONT>
<BR><FONT SIZE=2>From: Jean-Christian Imbeault</FONT>
<BR><FONT SIZE=2>[<A HREF="mailto:jean-christian.imbeault@(protected)">mailto
:jean-christian.imbeault@(protected)</A>]</FONT>
<BR><FONT SIZE=2>Sent: 07 April 2004 10:26</FONT>
<BR><FONT SIZE=2>To: J2EEPATTERNS-INTEREST@(protected)</FONT>
<BR><FONT SIZE=2>Subject: Separating SQL from code</FONT>
</P>
<BR>

<P><FONT SIZE=2>Hi, I'm somewhat new to patterns and J2EE but I was wondering
if someone</FONT>
<BR><FONT SIZE=2>could help with a question I have.</FONT>
</P>

<P><FONT SIZE=2>I'm wondering if there are any patterns of practices that
document ways to</FONT>
<BR><FONT SIZE=2>extract SQL from code or that discuss if this is a good thing
or not?</FONT>
</P>

<P><FONT SIZE=2>I have read the J2EE Patterns book and done a bit of research
(especially on</FONT>
<BR><FONT SIZE=2>DAO) but can find anything that talks about a total separation
of SQL from</FONT>
<BR><FONT SIZE=2>code. I am wondering is removing SQL from code (and possibly
placing it in a</FONT>
<BR><FONT SIZE=2>properties file or such) might be a good way of putting all
the SQL in one</FONT>
<BR><FONT SIZE=2>place to make changes (maintenance) easier.</FONT>
</P>

<P><FONT SIZE=2>The best I could find was this article which documents one
approach but not</FONT>
<BR><FONT SIZE=2>the pros or cons:</FONT>
</P>

<P><FONT SIZE=2><A HREF="http://www.javapractices.com/Topic105.cjp" TARGET="
_blank">http://www.javapractices.com/Topic105.cjp</A></FONT>
</P>

<P><FONT SIZE=2>Thanks!</FONT>
</P>

<P><FONT SIZE=2>Jean-Christian Imbeault</FONT>
</P>

<P><FONT SIZE=2>===============================================================
=====</FONT>
<BR><FONT SIZE=2>Companion Site: <A HREF="http://www.corej2eepatterns.com"
TARGET="_blank">http://www.corej2eepatterns.com</A></FONT>
<BR><FONT SIZE=2>J2EE BluePrints: <A HREF="http://java.sun.com/blueprints
/corej2eepatterns" TARGET="_blank">http://java.sun.com/blueprints
/corej2eepatterns</A></FONT>
<BR><FONT SIZE=2>List Archive: <A HREF="http://archives.java.sun.com/archives
/j2eepatterns-interest.html" TARGET="_blank">http://archives.java.sun.com
/archives/j2eepatterns-interest.html</A></FONT>
<BR><FONT SIZE=2>Unsubscribing: email &quot;signoff J2EEPATTERNS-INTEREST&quot;
to listserv@(protected)</FONT>
</P>

</BODY>
</HTML>
====================================================================
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)

©2008 junlu.com - Jax Systems, LLC, U.S.A.