Bug 8366 - sql:setDataSource not throwing JspException
Summary: sql:setDataSource not throwing JspException
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.0
Hardware: All All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2002-04-22 11:57 UTC by Lance Andersen
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Lance Andersen 2002-04-22 11:57:13 UTC
setDatasource which is passed an unititialized DataSource instance or a null
does  not
throw a JspException. the rest of the sql tags do throw an JspException

Neither of the following throw an exception
<sql:setDataSource dataSource="${null}" var='driverInfoDS' />

      pageContext.setAttribute("invalidDataSource", new TckDataSourceWrapper());
<sql:setDataSource dataSource="${invalidDataSource}" var='driverInfoDS' />
Comment 1 Jan Luehe 2002-04-25 00:18:53 UTC
The "Null & Error Handling" sections of <sql:setDataSource>, <sql:transaction>,
<sql:query>, and <sql:update> have been amended to say that a JspException is
thrown if 'dataSource' is specified but null.

However, <sql:setDataSource> is not going to check whether a given data source
has been initialized. If the data source hasn't been initialized, a subsequent
<sql:query> or <sql:update> will throw the exception.