Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Oliver Haag www.ohcon.de

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

save Data with db4o

// save Data with db4o

   1  
   2  import com.db4o.Db4o;
   3  import com.db4o.ObjectContainer;
   4  import com.db4o.ObjectSet;
   5  import com.db4o.query.Query;
   6  ...
   7  
   8  public class DbUtil {
   9  
  10    /**
  11    * save someObject to DB
  12    */
  13    public static void saveData(SomeClass someObject, String DbFilename) {
  14      ObjectContainer db=Db4o.openFile(DbFilename);
  15      try {
  16        db.set(idGenerator);
  17      }
  18      finally {
  19        db.close();
  20      }
  21    } //saveData(SomeClass ..)
  22  
  23    ..
  24  
  25  } //DbUtil
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS