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

Typo in "Storing and Updating Array Objects"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • docs
    • None

      In http://docs.oracle.com/javase/tutorial/jdbc/basics/array.html

      Storing and Updating Array Objects

      Use the methods PreparedStatement.setArray and PreparedStatement.setObject to pass an Array value as an input parameter to a PreparedStatement object.

      The following example sets the Array object northEastRegion (created in a previous example) as the second parameter to the PreparedStatement pstmt:

      PreparedStatement pstmt = con.prepareStatement(
          "insert into REGIONS (region_name, zips) " + "VALUES (?, ?)");
      pstmt.setString(1, "NorthEast");
      pstmt.setArray(2, northEastRegion);
      pstmt.executeUpdate();

      Similarly, use the methods PreparedStatement.updateArray and PreparedStatement.updateObject to update a column in a table with an Array value.

      Change: northEastRegion -> aArray

            bhoran Bernard Horan (Inactive)
            rgallard Raymond Gallardo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: