Bug 8366

Summary: sql:setDataSource not throwing JspException
Product: Taglibs Reporter: Lance Andersen <Lance.Andersen>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Severity: major CC: Ryan.Lubke
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   

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.