https://bz.apache.org/bugzilla/show_bug.cgi?id=58533

            Bug ID: 58533
           Summary: DelegatingConnection should propagate SQLException
                    (not return null)
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: anth...@whitford.com

I noticed code in org.apache.tomcat.dbcp.dbcp2.DelegatingConnection like:

    @Override
    public PreparedStatement prepareStatement(String sql) throws SQLException {
        checkOpen();
        try {
            DelegatingPreparedStatement dps = new DelegatingPreparedStatement(
                    this, _conn.prepareStatement(sql));
            initializeStatement(dps);
            return dps;
        }
        catch (SQLException e) {
            handleException(e);
            return null;
        }
    }

If there is a SQLException, I would expect that that gets propagated (just like
the signature suggests), not get a null.  I think this violates the spec.

This issue exists for 2 prepareStatement and 2 prepareCall implementations.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to