Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4914893

javax.sql.rowset.BaseRowSet: conflicting spec

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • docs
    • beta
    • sparc
    • solaris_2.6

      Name: sdR10048 Date: 08/29/2003


      Filed By : SPB JCK team (###@###.###)
      JDK : java full version "1.5.0-beta-b16"



      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...
      public void setAsciiStream(int parameterIndex,
                                 java.io.InputStream x,
                                 int length)
                          throws java.sql.SQLException
      . . .
      > Calls made to the method getParams after setAsciiStream has been called will
      > return an array containing the parameter values that have been set. The array
      > will include the given java.io.InputStream object as the value for parameter
      > placeholder number parameterIndex.
      . . .


      public java.lang.Object[] getParams()
                                   throws java.sql.SQLException
      Retrieves an array containing the parameter values that have been set for
      this RowSet object's command. Before the command is sent to the DBMS
      to be executed, these parameters will be substituted for placeholder
      parameters in the PreparedStatement object that is the command for
      this RowSet object.

      Each element in the array that is returned is an Object instance that contains
      the values of the parameters supplied to a setter method.
      The order of the elements is determined by the value supplied for parameterIndex.
      If the setter method takes only the parameter index and the value to be set,
      the array element will contain the value to be set (which must be expressed
      as an Object).

      > If there are additional parameters, the array element will itself
      > be an array containing the value to be set plus any additional parameter values
      > supplied to the setter method. These additional parameters are for the use of
      > the driver or the DBMS and may or may not be used.

      Returns:
          an array of Object instances that includes the parameter values that may be
          set in this RowSet object's command; an empty array if no parameters have
          been set
      Throws:
          java.sql.SQLException - if an error occurs

      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      There is conflict in BaseRowSet methods spec. In details:
      the spec for the methods:
      setAsciiStream(,,)
      setDate(,,)
      setNull(,,)
      setObject(,,)
      setObject(,,,)
      setTime(,,)
      setTimeStamp(,,)

      and for method getParams() are contradict each other:

      At one side after the designated method's calls getParams() will return an array
      with an appropriate Object at the appropriate place.
      And at the other side getParams() will return an array with a corresponding array
      at the appropriate place.

      Should be resolved.


      ======================================================================

      There is no contradiction in the documentation regarding the return value of the method BaseRowSet.getParams. The return value is always an array. However, the elements in the array may be either an Object or an array, depending on how many parameters there are. If there are more than two parameters, each element in the array that is returned is itself an array in order to accommodate the extra parameters.
      In all cases, the position in the array indicates which placeholder parameter is to be set. For example, the value to be set for the first parameter placeholder will be the first element in the array. That element may be an Object with the value to be set, or if there are more than two parameters supplied to a setter method, it may be an array that contains the value to be set plus the additional
      parameter.
      Also note that the return value for getParams is an array of Object instances, and an Object instance may be an array.
      ###@###.### 2003-10-31

            jbrucesunw Jonathan Bruce (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: