Bug 46086 - javax.servlet.jsp.jstl.sql.ResultSupport.java silently swallows SQLException
Summary: javax.servlet.jsp.jstl.sql.ResultSupport.java silently swallows SQLException
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.1
Hardware: All All
: P1 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-25 04:35 UTC by Biswadeep Chowdhury
Modified: 2008-11-07 10:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Biswadeep Chowdhury 2008-10-25 04:35:32 UTC
Please replace the catch clause in javax.servlet.jsp.jstl.sql.ResultSupport.java methods to throw a wrapped RuntimeException instead of silently swallowing SQLException.

Replace:
} catch (SQLException ex) {
            return null;
        }

By something like the following:

} catch (SQLException ex) {
            throw new RuntimeException(ex);
        }
Comment 1 Henri Yandell 2008-11-03 15:34:17 UTC
*grumble*

Easiest fix - throw SQLException from those methods. Can't - it's in the spec. Plus it would be a bit of a back compat surprise.

Next - create a new file - can't this is spec land. 

Next - use src/org/apache/taglibs/standard/tag/common/sql/ResultImpl.java directly rather than ResultSupport. Of course - that means people aren't using the spec anymore even if it is the same class (or copy of that class). Still - worth doing I think, so I've made that commit.

Next is your RuntimeException, but that's another back compat surprise for people. 

Here's my change:

svn ci -m "Adding constructors to ResultImpl to work around the SQLException hiding in ResultSupport - and noted this in ResultSupport as per #46086" src

Sending        src/javax/servlet/jsp/jstl/sql/ResultSupport.java
Sending        src/org/apache/taglibs/standard/tag/common/sql/ResultImpl.java
Transmitting file data ..
Committed revision 711123.