Exemplo n.º 1
0
 /** @deprecated using deprecated api */
 public void test() throws Exception {
   int originalActivationDepth = ((Config4Impl) Db4o.configure()).activationDepth();
   Db4o.configure().activationDepth(0);
   ObjectServer server = Db4oClientServer.openServer(tempFile(), -1);
   try {
     server.grantAccess("db4o", "db4o");
     ObjectContainer oc =
         Db4oClientServer.openClient("localhost", server.ext().port(), "db4o", "db4o");
     oc.close();
   } finally {
     Db4o.configure().activationDepth(originalActivationDepth);
     server.close();
   }
 }
Exemplo n.º 2
0
  public static void main(String[] args) throws Exception {
    // #example: Start a db4o server
    ObjectServer server = Db4oClientServer.openServer("database.db4o", 8080);
    try {
      server.grantAccess("user", "password");

      // Let the server run.
      letServerRun();
    } finally {
      server.close();
    }
    // #end example

  }