dbTalk Databases Forums  

Can I list all items using Cursor?

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss Can I list all items using Cursor? in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jack.tang
 
Posts: n/a

Default Can I list all items using Cursor? - 08-29-2006 , 11:42 AM






I knew it can be done

PrimaryIndex primaryIndex = EntityStore....
EntityCursor<Ticket> items = primaryIndex.entities();
for (Ticket item : items) {
ret.add(item);
}

So how can i do the same thing using Cursor? Thanks.

/Jack


Reply With Quote
  #2  
Old   
mark.hayes@oracle.com
 
Posts: n/a

Default Re: Can I list all items using Cursor? - 08-30-2006 , 10:10 AM






Hello Jack,

jack.tang wrote:
Quote:
I knew it can be done

PrimaryIndex primaryIndex = EntityStore....
EntityCursor<Ticket> items = primaryIndex.entities();
for (Ticket item : items) {
ret.add(item);
}

So how can i do the same thing using Cursor? Thanks.
I'm not sure what you're asking. Are you asking how to iterate over
records using the Cursor class (in the base API)? If so, please see
the Getting Started Guide:

http://www.sleepycat.com/jedocs/Gett...ide/index.html
http://www.sleepycat.com/jedocs/Gett...e/Cursors.html

Or are you asking how to use the Java 5 "for each" loop with the Cursor
class? If so, that isn't possible because Cursor does not implement
the Iterable interface.

Does this answer your question?
Mark



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.