home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Extras / ODesign / SetupPSE.exe / data.z / Make.java < prev    next >
Encoding:
Java Source  |  1997-04-23  |  772 b   |  40 lines

  1. package COM.odi.demo.rep;
  2.  
  3. /**
  4.  *      <H3>Copyright (C) Object Design Inc. 1996, 1997</H3>
  5.  *
  6.  * Make a database with one rectangle, stored in root "r1".
  7.  */
  8.  
  9. import COM.odi.*;
  10.  
  11. public
  12. class Make {
  13.     
  14.   public static void main(String argv[]) {
  15.  
  16.     ObjectStore.initialize(null, null);
  17.     
  18.     Point pa = new Point(1, 2);
  19.     Point pb = new Point(9, 10);
  20.     Rectangle rec = new Rectangle(pa, pb);
  21.     
  22.     Database db;
  23.  
  24.     try {
  25.       db = Database.open(argv[0], ObjectStore.OPEN_UPDATE);
  26.       db.destroy();
  27.     } catch (DatabaseNotFoundException e) {
  28.     }
  29.  
  30.     db = Database.create
  31.       (argv[0], ObjectStore.ALL_READ | ObjectStore.ALL_WRITE);
  32.     
  33.     Transaction t = Transaction.begin(ObjectStore.UPDATE) ;
  34.  
  35.     db.createRoot("r1", rec);
  36.  
  37.     t.commit();
  38.   }
  39. }
  40.