/** @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();
   }
 }
Example #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

  }
 private void start() {
   ObjectContainer oc =
       com.db4o.cs.Db4oClientServer.openClient(
           Db4oNetworking.HOST, _port, Db4oNetworking.USERNAME, Db4oNetworking.PASSWORD);
   oc.store(new Item(0));
   oc.commit();
   print("[0]");
   print(CLIENT_STARTED_OK);
   for (int i = 1; i < ITEM_COUNT; i++) {
     oc.store(new Item(i));
     oc.commit();
     print("[" + i + "]");
   }
   oc.close();
   print(CLIENT_COMPLETED_OK);
 }
 public void setUp() throws Exception {
   _applied = new ArrayList<DummyConfigurationItem>();
   _config = (ServerConfigurationImpl) Db4oClientServer.newServerConfiguration();
 }