tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "The Kelley's" <>
Subject RE: using datasource
Date Mon, 05 Aug 2002 00:17:00 GMT
I have never used JNDI.    I read the Tomcat docs but until I see an example
using JSTL...... What I would give for one spoon fed example.

Do I understand the JSTL in Action text correctly..

The text
However, the <sql:setDataSource> tag does not support connection pooling.
It's not designed to do so. Instead, Java programmers who set up default
for JSP pages have ample opportunity to set up their own pooling strategies.
so makes <sql:setDataSource> suitable only for applications where high
isn't crucial. In particular, <sql:setDataSource> is great for small

That's why I bought the book to use with databases. Arg!!!
Can I use JSTL with connection pooling? Doesn't sound like it.

-----Original Message-----
From: Hans Bergsten []
Sent: Sunday, August 04, 2002 3:01 PM
To: Tag Libraries Users List
Subject: Re: using datasource

anand wrote:
> Well what I mean was how you tell the JSTL to use what datasource.
> I have more than one datasource defined in config.xml that are
> Connection pooled.  In web xml
> Can I just say like this
> <context-param>
>   <param-name>
>        javax.servlet.jsp.jstl.sql.dataSource
>  </param-name>
>  <paramvalue>
>        myDataSource
>  </param-value>
> </context-param>

If that's the name it's been registered with in the JNDI java:comp/env/
context, yes. The J2EE spec recommends that you use a name that starts
with "jdbc", however, so "jdbc/myDataSource" would be the full name if
you follow the recommended conventions. The hard rule is that you must
use the same name as you declare with the <res-ref-name> element in the
web.xml file for the application.

How to tell the container how to create and configure a data source with
this name varies between containers. For Tomcat 4, it's done with the
<ResourceParams> element in the conf/server.xml file. See the Tomcat
docs for details:


<plug>I cover this in great detail in JavaServer Pages, Second Edition
(O'Reilly), to be released in August</plug>
Hans Bergsten 
Gefion Software
JavaServer Pages

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message