On Wed, 30 May 2001, Ellis, Neil (FNB) wrote:
> Hi,
>
> could the following be used in setQuery of the PreparedStatementImpl of the
> DBTags taglib library:
>
> public void setQuery(String query) throws SQLException, JspTagException{
> Connection conn = (Connection)pageContext.getAttribute(_connId);
> //NE: added Exception call and the relevant throws for this method and
> in interface StatementTag
> if(conn == null) {
> throw new JspTagException("There is no such connection
> '"+_connId+"'");
> }
> _statement = conn.prepareStatement(query);
> pageContext.setAttribute(getId(), _statement);
> }
>
> Otherwise I get a nasty null pointer.
Sounds reasonable. I'll make the change for you.
> Also please could the TLD be changed to allow more attributes to be dynamic,
> I had to change my version to allow me to set a dynamic column value for
> setColumn.
Perhaps. I think the default settings are pretty reasonable, so I'm not
sure it's worth changing, since it's so easily configured by the user.
- Morgan