Enterprise Information Portal APIs

com.ibm.mm.sdk.server
Class DKResultSetCursorIC

java.lang.Object
  |
  +--com.ibm.mm.sdk.server.dkAbstractResultSetCursor
        |
        +--com.ibm.mm.sdk.server.DKResultSetCursorIC
All Implemented Interfaces:
DKConstant, DKConstantIC, DKMessageId, DKMessageIdIC, dkResultSetCursor

public class DKResultSetCursorIC
extends dkAbstractResultSetCursor
implements DKConstantIC, DKMessageIdIC

This is the result set cursor for IC datastores. It is returned by the execute methods of the DKDatastoreIC class.

See Also:
DKDatastoreIC, DKDatastoreIC.execute( String, short, DKNVPair[] ), DKDatastoreIC.execute( dkQuery ), DKDatastoreIC.execute( DKCQExpr )

Fields inherited from interface com.ibm.mm.sdk.common.DKConstantIC
DK_CM_PARM_LINKS, DK_IC_DSTYPE
 
Fields inherited from interface com.ibm.mm.sdk.common.DKConstant
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageIdIC
DK_IC_MSG_MSGID_NOT_FOUND
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId
    For details, see the class or interface
 
Constructor Summary
DKResultSetCursorIC(DKDatastoreIC ds, java.lang.String entityName, dkResultSetCursor rs, DKNVPair[] params)
           
DKResultSetCursorIC(DKDatastoreIC ds, java.lang.String entityName, dkResultSetCursor rs, DKQExpr qe, DKNVPair[] params)
           
 
Method Summary
 void addObject(DKDDO ddo)
          Add an object to the cursor data set.
 int cardinality()
          Return the number of rows in the result set
 void close()
          Closes the cursor and invalidates the result set.
 java.lang.String datastoreName()
          Returns the name of the datastore that this cursor is operating against.
 java.lang.String datastoreType()
          Returns the type of the datastore that this cursor is operating against.
 void deleteObject()
          Delete an object from the cursor data set.
 void destroy()
          Closes and removes the cursor, allowing for cleanup before garbage collection.
 DKDDO fetchNext()
          Advances the cursor to the next position and returns the DKDDO that it points to.
 boolean fetchNextN(int howMany, dkCollection collection)
          Fetches the specified number of DKDDO objects and returns them in a collection.
 DKDDO fetchObject()
          Returns the DKDDO object at the current cursor position.
 DKDDO findObject(int position, java.lang.String predicate)
          Returns the first DKDDO object that matches the search condition.
 int getPosition()
          Returns the position of the cursor as an integer.
 DKHandle handle(java.lang.String type)
          Returns the result set handle that is associated with the result set cursor, by type.
 boolean isBegin()
          Returns whether or not the cursor is at the beginning of the dataset.
 boolean isEnd()
          Returns whether or not the cursor is at the ending of the dataset.
 boolean isInBetween()
          Returns whether or not the cursor is neither at the beginning or the ending of the dataset.
 boolean isOpen()
          Indicates whether or not this cursor is open.
 boolean isScrollable()
          Returns whether or not this cursor is scrollable.
 boolean isUpdatable()
          Returns whether or not this cursor is updatable.
 boolean isValid()
          Returns whether or not the cursor is in a valid state.
 DKDDO newObject()
          Creates an empty DKDDO of the object type referenced by this cursor.
 void open()
          Opens the cursor and, if necessary, executes the query to get the result set
 void setPosition(int position, java.lang.Object value)
          Sets the position of the cursor to the location specified.
 void setToNext()
          Sets the cursor to the next position.
 void updateObject(DKDDO ddo)
          Update an object in the cursor data set.
 
Methods inherited from class com.ibm.mm.sdk.server.dkAbstractResultSetCursor
fetchNextByName, fetchNextNByName, fetchObjectByName, handle, objectType, open
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DKResultSetCursorIC

public DKResultSetCursorIC(DKDatastoreIC ds,
                           java.lang.String entityName,
                           dkResultSetCursor rs,
                           DKNVPair[] params)
                    throws DKException,
                           java.lang.Exception

DKResultSetCursorIC

public DKResultSetCursorIC(DKDatastoreIC ds,
                           java.lang.String entityName,
                           dkResultSetCursor rs,
                           DKQExpr qe,
                           DKNVPair[] params)
                    throws DKException,
                           java.lang.Exception
Method Detail

isScrollable

public boolean isScrollable()
                     throws DKException,
                            java.lang.Exception
Returns whether or not this cursor is scrollable. For IC, no cursors are scrollable.
Overrides:
isScrollable in class dkAbstractResultSetCursor
Returns:
false, since IC cursors are not scrollable.

isUpdatable

public boolean isUpdatable()
                    throws DKException,
                           java.lang.Exception
Returns whether or not this cursor is updatable. For IC, no cursors are updatable.
Overrides:
isUpdatable in class dkAbstractResultSetCursor
Returns:
false, since IC cursors are not updatable.

isValid

public boolean isValid()
                throws DKException,
                       java.lang.Exception
Returns whether or not the cursor is in a valid state.
Overrides:
isValid in class dkAbstractResultSetCursor
Returns:
true if the cursor is valid, false if not.

isBegin

public boolean isBegin()
                throws DKException,
                       java.lang.Exception
Returns whether or not the cursor is at the beginning of the dataset.
Overrides:
isBegin in class dkAbstractResultSetCursor
Returns:
true if the cursor is at the beginning of the dataset, false if not.

isEnd

public boolean isEnd()
              throws DKException,
                     java.lang.Exception
Returns whether or not the cursor is at the ending of the dataset.
Overrides:
isEnd in class dkAbstractResultSetCursor
Returns:
true if the cursor is at the ending of the dataset, false if not.

isInBetween

public boolean isInBetween()
                    throws DKException,
                           java.lang.Exception
Returns whether or not the cursor is neither at the beginning or the ending of the dataset.
Overrides:
isInBetween in class dkAbstractResultSetCursor
Returns:
true if the cursor is not at the beginning or the ending of the dataset, false if it is at either the beginning or the ending.

getPosition

public int getPosition()
                throws DKException,
                       java.lang.Exception
Returns the position of the cursor as an integer.
Overrides:
getPosition in class dkAbstractResultSetCursor
Returns:
the index position of the cursor.

cardinality

public int cardinality()
                throws DKException,
                       java.lang.Exception
Return the number of rows in the result set
Overrides:
cardinality in class dkAbstractResultSetCursor
Following copied from interface: com.ibm.mm.sdk.common.dkResultSetCursor
Returns:
number of query results. May be approximation.

setPosition

public void setPosition(int position,
                        java.lang.Object value)
                 throws DKException,
                        java.lang.Exception
Sets the position of the cursor to the location specified.
Overrides:
setPosition in class dkAbstractResultSetCursor
Parameters:
position - Type of setPosition operation, either DK_CM_NEXT for advancing position one place or DK_CM_RELATIVE that advances the cursor by the amount specified in the value object.
value - An object, which must be an Integer, that contains the offset for the setPosition DK_CM_RELATIVE operation.

setToNext

public void setToNext()
               throws DKException,
                      java.lang.Exception
Sets the cursor to the next position.
Overrides:
setToNext in class dkAbstractResultSetCursor

fetchObject

public DKDDO fetchObject()
                  throws DKException,
                         java.lang.Exception
Returns the DKDDO object at the current cursor position.
Overrides:
fetchObject in class dkAbstractResultSetCursor
Following copied from interface: com.ibm.mm.sdk.common.dkResultSetCursor
Returns:
DDO

fetchNext

public DKDDO fetchNext()
                throws DKException,
                       java.lang.Exception
Advances the cursor to the next position and returns the DKDDO that it points to.
Overrides:
fetchNext in class dkAbstractResultSetCursor
Following copied from interface: com.ibm.mm.sdk.common.dkResultSetCursor
Returns:
DDO

fetchNextN

public boolean fetchNextN(int howMany,
                          dkCollection collection)
                   throws DKException,
                          java.lang.Exception
Fetches the specified number of DKDDO objects and returns them in a collection.
Overrides:
fetchNextN in class dkAbstractResultSetCursor
Parameters:
howMany - The number of objects to return. 0 is all.
collection - The collection to return the objects in.
Returns:
a boolean that is false if the cursor has been positioned at the end of the result set, true if not.

findObject

public DKDDO findObject(int position,
                        java.lang.String predicate)
                 throws DKException,
                        java.lang.Exception
Returns the first DKDDO object that matches the search condition.
Overrides:
findObject in class dkAbstractResultSetCursor
Parameters:
position - Type of findObject operation, only DK_CM_NEXT is supported. Indicates a search starting from the next position and advancing until the end.
predicate - The search condition of the form (i.e. Name='Financials 1999') must be the IC entity name, not DB2 or Federated entity names.
Returns:
the first DKDDO object matching the search condition, null if no object matches the search condition.

addObject

public void addObject(DKDDO ddo)
               throws DKException,
                      java.lang.Exception
Add an object to the cursor data set. Not supported in this connector.
Overrides:
addObject in class dkAbstractResultSetCursor
Throws:
DKUsageError - if this method is called.

deleteObject

public void deleteObject()
                  throws DKException,
                         java.lang.Exception
Delete an object from the cursor data set. Not supported in this connector.
Overrides:
deleteObject in class dkAbstractResultSetCursor
Throws:
DKUsageError - if this method is called.

updateObject

public void updateObject(DKDDO ddo)
                  throws DKException,
                         java.lang.Exception
Update an object in the cursor data set. Not supported in this connector.
Overrides:
updateObject in class dkAbstractResultSetCursor
Throws:
DKUsageError - if this method is called.

newObject

public DKDDO newObject()
                throws DKException,
                       java.lang.Exception
Creates an empty DKDDO of the object type referenced by this cursor.
Overrides:
newObject in class dkAbstractResultSetCursor
Returns:
the empty DKDDO.

open

public void open()
          throws DKException,
                 java.lang.Exception
Opens the cursor and, if necessary, executes the query to get the result set
Overrides:
open in class dkAbstractResultSetCursor

close

public void close()
           throws DKException,
                  java.lang.Exception
Closes the cursor and invalidates the result set.
Overrides:
close in class dkAbstractResultSetCursor

isOpen

public boolean isOpen()
               throws DKException,
                      java.lang.Exception
Indicates whether or not this cursor is open.
Overrides:
isOpen in class dkAbstractResultSetCursor
Returns:
true if the cursor is open, false if it is not.

destroy

public void destroy()
             throws DKException,
                    java.lang.Exception
Closes and removes the cursor, allowing for cleanup before garbage collection.
Overrides:
destroy in class dkAbstractResultSetCursor

datastoreName

public java.lang.String datastoreName()
                               throws java.lang.Exception
Returns the name of the datastore that this cursor is operating against.
Overrides:
datastoreName in class dkAbstractResultSetCursor
Returns:
the name of the datastore this cursor is operating against.

datastoreType

public java.lang.String datastoreType()
                               throws java.lang.Exception
Returns the type of the datastore that this cursor is operating against.
Overrides:
datastoreType in class dkAbstractResultSetCursor
Returns:
the type of the datastore this cursor is operating against.

handle

public DKHandle handle(java.lang.String type)
                throws java.lang.Exception
Returns the result set handle that is associated with the result set cursor, by type.
Overrides:
handle in class dkAbstractResultSetCursor
Returns:
the result set handle of this cursor.

EIP Java APIs

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.