Why don't you just read the password from a context parameter?  It's
directly supported in the DBTags syntax:

  <sql:password initParameter="<your context parameter here>"/>


----- Original Message -----
From: "Karen E. Lee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 17, 2001 1:53 PM
Subject: Re: DB connection tag question


> I am trying to write a little extension to the dbtags tablib which reads a
password from a properties file instead of directly from the body of the
jsp.  At this point out of frustration I have simplified it down to:
>
> ---------------------------------------
> package edu.ufl.osg.dbtags.connection;
>
> import java.io.*;
> import java.util.*;
> import javax.naming.*;
> import javax.servlet.jsp.JspTagException;
> import javax.servlet.jsp.tagext.BodyTagSupport;
> import org.apache.taglibs.dbtags.connection.*;
>
> public class PropFileTag extends BodyTagSupport {
>
>    public int doEndTag() throws JspTagException{
> try {
>     ConnectionTag connTag = (ConnectionTag) findAncestorWithClass(this,
>
Class.forName("org.apache.taglibs.dbtags.connection.ConnectionTag"));
>     connTag.setPassword("myPassword");
> }
>
> catch (Exception e) {
>     e.printStackTrace();
> }
>
> return EVAL_PAGE;
>   }
> }
> ----------------------------------------
>
> This is still returning a null password exception:
>    java.lang.IllegalArgumentException: null password with user:karenlee
>       at
com.ibm.ejs.cm.pool.ConnectionPool.allocateConnection(ConnectionPool.java:47
2)
>
> If I abandon my propfiletag and just use <DBTags:password> it works fine.
Any idea what's going on? Thanks.
>
>
>
> --
> Karen Lee
> Open Systems Group
> Northeast Regional Data Center
> University of Florida
> [EMAIL PROTECTED]


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to