I would also like to chime in with my agreement with Henri, Tim, and Michael. Within the proper context, the <sql: tags are useful; I would hate for a useful tool to be dumped simply because it doesn't fit within a certain practice of programming or because there's the danger that it can be used to create ugly code.
In defense of my original proposal, what I was trying to do (and what I did do) was create a couple of tags that present a complex HTML table that use lots of date and time based data. I have the model for this project in the Java layer, but I simply found it more elegant to write a couple of SQL statements to access the model in this context (especially because of the date/time component), and now I have tags that will display this view on any page of the web application that I want. To me, it's useful to simply use the data source stuff that comes from the <sql tags. I also want to thank the Jakarta taglib team for their work on the "unstandard" tag lib. I was eventually going to write a tag that duplicated the functionality of the <un:invoke> tag but you're beating me to the punch. Thanks! James ----- Original Message ----- From: "Michael Duffy" <[EMAIL PROTECTED]> To: "Tag Libraries Users List" <[EMAIL PROTECTED]> Sent: Monday, July 14, 2003 9:36 AM Subject: RE: Stored procedure (RFI proposal) > > I agree with Henri and Tim. > > Rather than seeing dogmatic rules about "never" and > "always", I prefer to hear the reasons for doing > things and some guidance on when it might be > acceptable to break with convention AND what the > consequences of doing that could be. > > I do believe that Model-2 MVC is a good way to go, but > I've stopped being rigid about "no SQL in JSPs" after > reading the argument posted to this list that > suggested the ratio of page/Java developers on a > project as a guide. That seemed rational to me. JMHO > - MOD > > --- Henri Yandell <[EMAIL PROTECTED]> wrote: > > > > I do exactly the same thing [though I have multiple > > JSP controllers]. You > > still maintain good MVC, without the assumption that > > Model-2 is some kind > > of gospel we must believe in. > > > > I used the sql-taglib of the JSTL and it worked > > relatively well. Some > > issues with choosing DataSources dynamically. > > > > Hen > > > > On Mon, 14 Jul 2003, Chen, Gin wrote: > > > > > One instance it makes sense is if you use a JSP > > for your controller. > > > A JSP compiles into a Servlet anyways so sometimes > > it makes it easier to > > > write a JSP that is nothing more than controller > > functionality (no display) > > > then to write and configure a Servlet. > > > I know that the SQL taglib saved me HUGE amounts > > of time on a small project > > > that I worked on just because of the fact that I > > used it this way. > > > > > > -Tim > > > > > > -----Original Message----- > > > From: Martin van Dijken > > [mailto:[EMAIL PROTECTED] > > > Sent: Monday, July 14, 2003 6:02 AM > > > To: Tag Libraries Users List > > > Subject: RE: Stored procedure (RFI proposal) > > > > > > > > > Agreed, > > > > > > I think it a horrific thing to do data > > manipulation in a JSP tag in the > > > first place. Personally I think the whole > > SQL-taglib is something that never > > > should have been invented in the first place. > > > > > > Martin > > > > > > > -----Original Message----- > > > > From: Vic Cekvenich > > [mailto:[EMAIL PROTECTED] > > > > Sent: zaterdag 12 juli 2003 1:21 > > > > To: [EMAIL PROTECTED] > > > > Subject: Re: Stored procedure (RFI proposal) > > > > > > > > > > > > Of course... data access in a presentation view > > is bad practice, much > > > > better to unit test a bean (with DAO, such as > > iBatis.com) in > > > > an MVC way. > > > > Then you can reuse you bean for Soap, etc., not > > just JSP and > > > > keep your > > > > JSP code clean. > > > > > > > > > > > > Michael Duffy wrote: > > > > > > > > >Do you mean you want to batch commands, the way > > the > > > > >java.sql.Statement.addBatch allows you to? > > That would > > > > >be useful to lots of people, I'll bet. I think > > that > > > > >would require tag changes, too. > > > > > > > > > >I can see a <sql:batch> tag that could have > > multiple > > > > ><sql:update> children. Do they do such a thing > > in > > > > >Jakarta's DBTags taglib? - MOD > > > > > > > > > >--- James Smith <[EMAIL PROTECTED]> > > wrote: > > > > > > > > > > > > > > >>I was actually dealing with a similar problem > > > > >>yesterday; I wanted to write a > > > > >>tag that called not a stored procedure, but > > several > > > > >>SQL statements in a row, > > > > >>using a dataSource, just like I would use for > > > > >><sql:xxxx> tags. After > > > > >>looking through the source code, I noticed > > that the > > > > >>abstract classes > > > > >> > > > > >> > > > > >> > > > > > > > >org.apache.taglibs.standard.tag.common.sql.QueryTagSupport > > > > > > > > > > > > > > >>and > > > > >> > > > > >> > > > > >> > > > > > > > >org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport > > > > > > > > > > > > > > >>both used the > > > > >>exact same code to access a data source. So, > > I was > > > > >>wondering if in future > > > > >>versions of the tag library, we could have an > > > > >>abstract tag that extended > > > > >>BodyTagSupport and did all the work of getting > > the > > > > >>dataSource and database > > > > >>connection, and then QueryTagSupport and > > > > >>UpdateTagSupport (I didn't look at > > > > >>TransactionTagSupport that closely, but I'm > > assuming > > > > >>it does something > > > > >>similar) could inherit from that class, as > > could any > > > > >>other tags that would, > > > > >>say, call multiple SQL statements or call a > > stored > > > > >>proc using a JSTL > > > > >>dataSource. Since I haven't looked at the > > source > > > > >>code for the standard > > > > >>taglibs under Tomcat 5-alpha, I don't know if > > this > > > > >>idea would still be > > > > >>compatible with the newer code, but if it is, > > I > > > > >>think it would be useful. > > > > >>Just an idea! Thanks, > > > > >> > > > > >>James Smith > > > > >>Application Systems Analyst, Treistman Center > > > > >>College of Fine Arts, University of Arizona > > > > >> > > > > >>----- Original Message ----- > > > > >>From: "Michael Duffy" <[EMAIL PROTECTED]> > > > > >>To: "Tag Libraries Users List" > > > > >><[EMAIL PROTECTED]> > > > > >>Sent: Wednesday, July 02, 2003 4:40 AM > > > > >>Subject: Re: Stored procedure > > > > >> > > > > >> > > > > >> > > > > >> > > > > >>>Not if the underlying implementation isn't > > using > > > > >>>CallableStatement. Stored procs can have in, > > out, > > > > >>> > > > > >>> > > > > >>and > > > > >> > > > > >> > > > > >>>inout parameters. They can also return > > multiple > > > > >>>ResultSets. > > > > >>> > > > > >>>When I look at the java.sql.CallableStatement > > > > >>>javadocs, it seems clear to me that it's a > > very > > > > >>>different animal from Statement and > > > > >>> > > > > >>> > > > > >>PreparedStatement. > > > > >> > > > > >> > > > > >>> The taglibs that support it will look very > > > > >>> > > > > >>> > > > > >>different > > > > >> > > > > >> > > > > >>>from the JSTL sql taglib. JMHO - MOD > > > > >>> > > > > >>>--- Daniel Montero <[EMAIL PROTECTED]> wrote: > > > > >>> > > > > >>> > > > > >>>>I believe you can just do something like > > > > >>>><sql:query datasource="jdbc/myds" sql="exec > > > > >>>> > > > > >>>> > > > > >>my_proc" > > > > >> > > > > >> > > > > >>>>/> > > > > >>>> > > > > >>>>just like any other sql statement. > > > > >>>> > > > > >>>> > > > > >>>> > > > > >>>>----- Original Message ----- > > > > >>>>From: "Kevin Passey" > > <[EMAIL PROTECTED]> > > > > >>>>To: "Taglibs (E-mail)" > > > > >>>><[EMAIL PROTECTED]> > > > > >>>>Sent: Tuesday, July 01, 2003 9:40 AM > > > > >>>>Subject: Stored procedure > > > > >>>> > > > > >>>> > > > > >>>> > > > > >>>> > > > > >>>>>Hi, > > > > >>>>> > > > > >>>>>Are there any taglibs which I can use to > > call > > > > >>>>> > > > > >>>>> > > > > >>a > > > > >> > > > > >> > > > > >>>>stored procedure. > > > > >>>> > > > > >>>> > > > > >>>>>Thanks > > > > >>>>> > > > > >>>>>Kevin > > > > >>>>> > > > > >>>>> > > > > >>>>> > > > > >>>> > > > > >>>> > > > > > > > >--------------------------------------------------------------------- > > > > > > > > > > > > > > >>>>To unsubscribe, e-mail: > > > > >>>>[EMAIL PROTECTED] > > > > >>>>For additional commands, e-mail: > > > > >>>>[EMAIL PROTECTED] > > > > >>>> > > > > >>>> > > > > >>>> > > > > >>>__________________________________ > > > > >>>Do you Yahoo!? > > > > >>>SBC Yahoo! DSL - Now only $29.95 per month! > > > > >>>http://sbc.yahoo.com > > > > >>> > > > > >>> > > > > >>> > > > > >>> > > > > > > > >--------------------------------------------------------------------- > > > > > > > > > > > > > > >>>To unsubscribe, e-mail: > > > > >>> > > > > >>> > > > > >>[EMAIL PROTECTED] > > > > >> > > > > >> > > > > >>>For additional commands, e-mail: > > > > >>> > > > > >>> > > > > >>[EMAIL PROTECTED] > > > > >> > > > > >> > > > > >> > > > > >> > > > > >> > > > > > > > >--------------------------------------------------------------------- > > > > > > > > > > > > > > >>To unsubscribe, e-mail: > > > > >>[EMAIL PROTECTED] > > > > >>For additional commands, e-mail: > > > > >>[EMAIL PROTECTED] > > > > >> > > > > >> > > > > >> > > > > > > > > > > > > > > >__________________________________ > > > > >Do you Yahoo!? > > > > >SBC Yahoo! DSL - Now only $29.95 per month! > > > > >http://sbc.yahoo.com > > > > > > > > > > > > > > > > > > -- > > > > Vic Cekvenich, > > > > Struts Instructor, > > > > 1-800-917-JAVA > > > > > > > > Advanced <a href ="baseBeans.com">Struts > > Training</a> and > > > > project recovery in North East. > > > > Open Source <a href ="baseBeans.com">Content > > Management</a> > > > > basicPortal sofware > > > > Best practice<a href ="baseBeans.com">Struts > > Support</a> > > > > v.1.1 helper ScafflodingXPress > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > __________________________________ > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! > http://sbc.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]