I tried to reproduce your problem but was unsuccessful. I set my driver
class name, url, user name, and password all using context init params
without the problem you mentioned.

If you look at the sql driver tag handler, all it does is check whether the
parameter is set via an action attribute and if not set then gets the
context init parameter values. What's strange is that if your driver class
name is null, an exception is thrown right away however that is not the same
exception you mention in your e-mail. The driver class name context init
param must be picked up properly.

To get to the bottom of what's happening, can you print out your context
init parameter values right before your sql:driver tag:

----
<hr>
<% out.println(
pageContext.getServletContext().getInitParameter("javax.servlet.jsp.jstl.sql
.driver") ); %> <hr>
<% out.println(
pageContext.getServletContext().getInitParameter("javax.servlet.jsp.jstl.sql
.url") ); %> <hr>
<% out.println(
pageContext.getServletContext().getInitParameter("javax.servlet.jsp.jstl.sql
.user") ); %> <hr>
<% out.println(
pageContext.getServletContext().getInitParameter("javax.servlet.jsp.jstl.sql
.password") ); %> <hr>
----

Thanks!

Justy

----- Original Message -----
From: "Ingmar Stein" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 14, 2002 8:04 AM
Subject: [standard] <sql:driver> problem


> Hi all,
>
> the init-parameters do not work as expected when using <sql:driver>.
>
> I added all the init-parameters (using the new names for the latest
nightly
> build), but
>
> <sql:driver var="conn"/>
>
> gives a "Url may not be null" when I execute a <sql:query>.
> But it works if I add this right after the <sql:driver> tag:
>
> <%
> DataSourceWrapper conn =
> (DataSourceWrapper)pageContext.getAttribute("conn");
> conn.setDriverClassName(
pageContext.getServletContext().getInitParameter("j
> avax.servlet.jsp.jstl.sql.driver") );
> conn.setJdbcURL(
pageContext.getServletContext().getInitParameter("javax.ser
> vlet.jsp.jstl.sql.url") );
> conn.setUserName(
pageContext.getServletContext().getInitParameter("javax.se
> rvlet.jsp.jstl.sql.user") );
> conn.setPassword(
pageContext.getServletContext().getInitParameter("javax.se
> rvlet.jsp.jstl.sql.password") );
> %>
>
> Cheers,
>
> Ingmar Stein
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to