How to connect ObjectBox to server instance?

115 views Asked by At

I have a use-case wherein I have to connect objectbox from Java to server instance.

I tried with Sync but getting error stating "sync not supported". Below is my code,

BoxStore boxStore = MyObjectBox.builder().name("TestEntity-db").build();
Box<TestEntity> box = boxStore.boxFor(TestEntity.class);
boolean syncAvailable = Sync.isAvailable();
System.out.println("ObjectBox Sync is " + syncAvailable);         
SyncClient syncClient = Sync.client( boxStore, "ws://12.456.672.89:9999", SyncCredentials.none() ).buildAndStart();

Can someone help in this?

0

There are 0 answers