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

Compilation error in tutorial example(JDBC TM RowSet Implementations Tutorial)

XMLWordPrintable

    • x86
    • windows_xp

      A DESCRIPTION OF THE PROBLEM :
      There are two errors in the example founded in JDBC RowSet Implementations Tutorial page 25.

      The variable "2006_04_01" can't start using a number and there isn't valueOf method in class java.util.Date.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      crs.moveToInsertRow();
      crs.updateInt("WAREHOUSE_ID", 1234);
      crs.updateString("COF_NAME", "Supremo");
      crs.updateInt("SUP_ID", 150);
      crs.updateInt("QUAN", 580);
      java.sql.Date Date2006_04_01 = java.sql.Date.valueOf("2006-04-01");
      crs.updateDate("DATE", Date2006_04_01);
      crs.insertRow();
      crs.moveToCurrentRow();

      ACTUAL -
      crs.moveToInsertRow();
      crs.updateInt("WAREHOUSE_ID", 1234);
      crs.updateString("COF_NAME", "Supremo");
      crs.updateInt("SUP_ID", 150);
      crs.updateInt("QUAN", 580);
      java.util.Date 2006_04_01 = java.util.Date.valueOf("2006-04-01");
      crs.updateDate("DATE", 2006_04_01);
      crs.insertRow();
      crs.moveToCurrentRow();


      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/developer/onlineTraining/Database/jdbcrowsets.pdf
      ###@###.### 2004-12-17 17:54:20 GMT

            lancea Lance Andersen
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: