Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-17-2008, 08:46 AM
Java Tip's Avatar
Moderator
 
Join Date: Nov 2007
Posts: 1,691
Rep Power: 5
Java Tip will become famous soon enoughJava Tip will become famous soon enough
Default JDO - Retrieving a persisted object
The following code snippet shows how to retrieve persisted objects.

Code:
try {
   tx = pm.currentTransaction();
   tx.begin();
   Extend ex = pm.getExtent(Employee.class, true);
   Iterator i = ex.iterator();
   while(i.hasNext()) {
     Employee obj = (Employee) i.next();
   }
   tx.commit();
} catch (Exception e) {
   if(tx.isActive()) {
      tx.rollback();
   }
}
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
storing and retrieving a file as such anil_manu Advanced Java 0 03-11-2008 02:27 PM
retrieving Properties bugger New To Java 1 01-13-2008 10:44 PM
Retrieving out objects from Vector tuckker New To Java 3 12-03-2007 06:52 AM
Retrieving data from the DB yuchuang Database 2 11-27-2007 09:59 AM
Retrieving serialized objects from file JavaForums Java Blogs 0 11-07-2007 10:03 PM


All times are GMT +2. The time now is 03:42 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org