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

javax.sql.rowset.BaseRowSet.setCommand throws NPE

XMLWordPrintable

    • 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"
      Tests fail:
      api/javax_sql/rowset/BaseRowSet/index.html#Options3[BaseRowSet2022]
      api/javax_sql/rowset/BaseRowSet/index.html#Options3[BaseRowSet0006]

      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...
      public void setCommand(java.lang.String cmd)
                      throws java.sql.SQLException
      Sets this JDBC RowSet object's command property to the given String object and clears the parameters, if any, that were set for the previous command.

      The command property may not be needed if the JDBC RowSet object is
      produced by a data source, such as a spreadsheet, that does not support
      commands. Thus, this property is optional and may be null.

      Parameters:
      cmd - a String object containing an SQL query that will be set as this
      RowSet object's command property; may be null but may not be
      an empty string
      Throws:
      java.sql.SQLException - if an empty string is provided as the command value
      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      BaseRowSet.steCommand throws NullPointerException. See demo:

      Demo:
      import javax.sql.rowset.*;
      import javax.sql.*;

      public class T {

          public static void main(String[] args) {
              MyBaseRowSet rs = new MyBaseRowSet();
              try {
                  rs.setCommand("select man from mytable");
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }

      class MyBaseRowSet extends BaseRowSet {

          public MyBaseRowSet() {
              super();
          }
      }


      Demo's output:

      java.lang.NullPointerException
              at javax.sql.rowset.BaseRowSet.setCommand(BaseRowSet.java:567)
              at T.main(T.java:9)

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

      Name: sdR10048 Date: 08/29/2003

      These testcases fail also:
      api/javax_sql/rowset/BaseRowSet/index.html#Params1[BaseRowSet0008]
      api/javax_sql/rowset/BaseRowSet/index.html#Params1[BaseRowSet0010]
      api/javax_sql/rowset/BaseRowSet/index.html#Params1[BaseRowSet0012]
      api/javax_sql/rowset/BaseRowSet/index.html#Params1[BaseRowSet0014]
      api/javax_sql/rowset/BaseRowSet/index.html#Params1[BaseRowSet0016]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0018]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0020]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0022]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0023]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0024]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0025]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0026]
      api/javax_sql/rowset/BaseRowSet/index.html#Params3[BaseRowSet0027]


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

      Name: sdR10048 Date: 08/29/2003

      These testcases fail also:
      api/javax_sql/rowset/BaseRowSet/index.html#Params1[BaseRowSet0008]
      api/javax_sql/rowset/BaseRowSet/index.html#Params1[BaseRowSet0010]
      api/javax_sql/rowset/BaseRowSet/index.html#Params1[BaseRowSet0012]
      api/javax_sql/rowset/BaseRowSet/index.html#Params1[BaseRowSet0014]
      api/javax_sql/rowset/BaseRowSet/index.html#Params1[BaseRowSet0016]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0018]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0020]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0022]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0023]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0024]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0025]
      api/javax_sql/rowset/BaseRowSet/index.html#Params2[BaseRowSet0026]
      api/javax_sql/rowset/BaseRowSet/index.html#Params3[BaseRowSet0027]


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

            ahandasunw Amit Handa (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: