DB2®ResultSet.Sensitive Property

Gets a value indicating if the cursor is sensitive to updates made by the application and other cursors.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax


[Visual Basic]
Public Property Sensitive As Boolean
[C#]
public bool Sensitive {get;}
[C++]
public: __property bool get_Sensitive();
[JScript]
public function get Sensitive() : Boolean;

Property value

true if the DB2ResultSet is sensitive to updates; otherwise, false.

Remarks

Depending on the data server your application is connected to, the attributes of the DB2ResultSet instance can be different than what the application assigned them to be in the DB2Command.ExecuteResultSet method. Use this property to verify that this DB2ResultSet instance is sensitive to updates.

Keyset and dynamic cursors are always sensitive.

Example

[C#] The following example demonstrates how to determine if the DB2ResultSet instance is sensitive to updates from other cursors, and read data from it, if so.

[C#]
  public static string getSalesData(DB2Connection conn)
  {
    string salesQuery = "SELECT * FROM SALES";
    string salesData = "";
    DB2Command cmd = new DB2Command(salesQuery, conn);
    DB2ResultSet salesRS = cmd.ExecuteResultSet(
      DB2ResultSetOptions.Scrollable |
      DB2ResultSetOptions.Sensitive |
      DB2ResultSetOptions.SkipDeleted);

    if (salesRS.Sensitive)
    {
      if (salesRS.ReadLast())
      {
        salesData = salesRS.GetDB2Date(0).ToString();
        salesData += ", " + salesRS.GetDB2String(1).ToString();
        salesData += ", " + salesRS.GetDB2String(2).ToString();
        salesData += ", " + salesRS.GetDB2Int32(3).ToString();
      }
    }

    return salesData;
}