You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by "Zvolensky, Thomas J {PDBI~Nutley}" <TH...@ROCHE.COM> on 2002/05/17 17:32:41 UTC

Multiple queries in one jsp

I have a form page that I would like to populate several drop-downs with
values in a database table.  It works fine with one query for the first
element.  When I add the second query to the code, the page comes up as a
blank.

Here is my query code:

<sql:driver
  var="example"
  driver="oracle.jdbc.OracleDriver"
  url="jdbc:oracle:thin:@nuoradcm.tot.roche.com:1537:rapiddcm"
/>

<sql:query var="docbase" dataSource="${example}">
select distinct DOCBASE from Authentications order by DOCBASE
</sql:query>

<sql:query var="site" dataSource="${example}">
select distinct CITY from Authentications order by CITY
</sql:query>

Is it possible to perform multiple queries in the same page?

Re: Multiple queries in one jsp

Posted by Shawn Bayern <ba...@essentially.net>.
On Fri, 17 May 2002, Zvolensky, Thomas J {PDBI~Nutley} wrote:

> I have a form page that I would like to populate several drop-downs
> with values in a database table.  It works fine with one query for the
> first element.  When I add the second query to the code, the page
> comes up as a blank.

There shouldn't be any problem with what you're tring to do.  What do you
mean by "the page comes up as a blank"?  The code you've shown won't print
anything, so the problem most likely involves the way you're trying to
print the results.  After code like this:

> <sql:driver
>   var="example"
>   driver="oracle.jdbc.OracleDriver"
>   url="jdbc:oracle:thin:@nuoradcm.tot.roche.com:1537:rapiddcm"
> />
> 
> <sql:query var="docbase" dataSource="${example}">
> select distinct DOCBASE from Authentications order by DOCBASE
> </sql:query>
> 
> <sql:query var="site" dataSource="${example}">
> select distinct CITY from Authentications order by CITY
> </sql:query>

... you could try to inspect the 'docbase' and 'site' variables manually
to ensure they contain the data you expect.

-- 
Shawn Bayern
"JSP Standard Tag Library"   http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>