Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-1780

[MTDCS]jPrepareStatement execute twice, second ResultSet is empty

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • connectivity-dcs
    • None

    Description

      //there is 1 row in table t1.
      String query = "SELECT * FROM t1 WHERE id=? AND name=?";
      conn.setAutoCommit(true);
      try {
      PreparedStatement statement = conn.prepareStatement(query);
      statement.setString(1, "1");
      statement.setString(2, "1");
      ResultSet rs = statement.executeQuery();
      assertTrue(rs.next());
      assertFalse(rs.next());
      rs.close();
      // Run another query through same connection and make sure
      // you can't find the new row
      rs = statement.executeQuery();
      assertTrue(rs.next());//Error here
      } finally {
      }

      Attachments

        Activity

          People

            kevinxu021 Kevin Xu
            kevinxu021 Kevin Xu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: