Download presentation
Presentation is loading. Please wait.
1
Fall 2009ACS-4902 R McFadyen1 OODBMS Native ODBMS db4o www.db4o.com Consider the model for the Persistence example on the web site section student *
2
Fall 2009ACS-4902 R McFadyen2 OODBMS import …Makes the db4o classes available to us. ObjectContainer db = Db4o.openFile(“…”); If the database does not exist, db4o creates it. The database is then opened for use. db.commit();This statement ends the current transaction. It indicates the end of a unit of work that must be committed in its entirety to the database. db.close();This statement closes the database for us and makes it available to another application. db.store(section);This one statement is all that is necessary to have the section object saved to the database.
3
Fall 2009ACS-4902 R McFadyen3 OODBMS Consider code in folder Persistence example on web site: SectionDriver, Section, and Student comprise a 1903 example using arrays of objects CreateStudentDatabase: creates a database of sections where a section contains student objects ListDatabase: lists section objects and student objects in database ClearDatabase: removes all sections and students from the database
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.