Determines whether the end of a cursor has been reached.
PSCursorClass objects
cursorobject.EOF( )
Argument |
Description |
---|---|
cursorobject |
A variable that contains a reference to an instance of PSCursorClass |
Boolean. Returns true if the end of the cursor has been reached, and false if it has not.
At runtime, EOF calls the isAfterLast method on the ResultSet object to determine if the end of the cursor has been reached.
The following example uses EOF in a loop to determine whether all of the rows in a cursor have been processed:
String myquery;
PSConnectionClass myconnect;
PSCursorClass mycursor;
boolean dberror;
myConnect = psServer.CreateConnection(pageContext, "com.sybase.jdbc2.jdbc.SybDriver", "jdbc:sybase:Tds:localhost:2638", "dba", "sql", true);
...
myquery = "SELECT products.prod_id, products.prod_name FROM DBA.products";
mycursor = myconnect.CreateCursor(myquery);
if ( myconnect.GetError() == null )
{
for (i=0; (!mycursor.EOF()); i++)
{
psDocument.Write(mycursor.GetValue(0) + " " + mycursor.GetValue(1));
psDocument.Write("<BR>");
mycursor.MoveNext();
}
else dberror = true;