home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-04-23 | 772 b | 40 lines |
- package COM.odi.demo.rep;
-
- /**
- * <H3>Copyright (C) Object Design Inc. 1996, 1997</H3>
- *
- * Make a database with one rectangle, stored in root "r1".
- */
-
- import COM.odi.*;
-
- public
- class Make {
-
- public static void main(String argv[]) {
-
- ObjectStore.initialize(null, null);
-
- Point pa = new Point(1, 2);
- Point pb = new Point(9, 10);
- Rectangle rec = new Rectangle(pa, pb);
-
- Database db;
-
- try {
- db = Database.open(argv[0], ObjectStore.OPEN_UPDATE);
- db.destroy();
- } catch (DatabaseNotFoundException e) {
- }
-
- db = Database.create
- (argv[0], ObjectStore.ALL_READ | ObjectStore.ALL_WRITE);
-
- Transaction t = Transaction.begin(ObjectStore.UPDATE) ;
-
- db.createRoot("r1", rec);
-
- t.commit();
- }
- }
-