Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-1227

Network Server should not use the underlying embedded prepared statement when accessing a BrokeredPreparedStatement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.1.2.1
    • 10.1.3.3, 10.2.1.6
    • Network Server
    • None
    • Patch Available

    Description

      Network Server should not use the underlying embedded
      Prepared statement when accessing a BrokeredPreparedStatement.

      In DERBY-1025 Dan pointed out this code which while not related to DERBY-1025 does appear to be a problem. Here is his comment regarding this code in DRDAStatement:

      /**

      • Get prepared statement
        *
      • @return prepared statement
        */
        protected PreparedStatement getPreparedStatement() throws SQLException
        {
        if (ps instanceof BrokeredPreparedStatement)
        return (PreparedStatement)(
        ((BrokeredPreparedStatement) ps).getStatement());
        else
        return ps;
        }

      This code, for some unknown reason due to lack of comments, is getting the underlying embedded statement
      from a BrokeredPreparedStatement. This should not be allowed, the BrokeredStatement wrappers are there to
      hide the embedded statement object as it can change under the covers of the wrapper.

      Attachments

        1. 10.1_p1_derby1227.diff.txt
          0.6 kB
          Sunitha Kambhampati

        Activity

          People

            skambha Sunitha Kambhampati
            kmarsden Katherine Marsden
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: