ConfD User Community

Is there java cdb api which can support writing data to cdb?


#1

I am working on a project which I need to set CDB stored operation data (tailf:cdb-oper) in CDB.
I can see there are C APIs and Python APIs to do writing. I just wonder whether there is Java API which can write to CDB similar as C or Python APIs ?

Or is there any other approach which can write the CDB stored operation data ?

Thanks.


#2

With ConfD Premium, you can use the Java API as well just like the C and Python APIs to write operational data into CDB.


#3

Ok, I got the JAVA API and try to use it to write operational data to CDB. But I found the operational data can’t be written to CDB. The below is my codes

int port = Conf.PORT;
Socket s = new Socket("localhost", port);
Cdb cdbReadSocket = new Cdb("MyReadCdbSocket", s);
CdbSession cdbSession = cdbReadSocket.startSession(CdbDBType.CDB_OPERATIONAL);
cdbSession.setElem(new ConfHexString("12345"), "/system/information/version");
cdbSession.endSession();
s.close();

Unfortunately, I can’t find a complete code example such as writting operational data to CDB. Any idea why my code doesn’t work ?


#4

For ConfD’s Java API which is specific to ConfD Premium, it is best to file your questions via the RT ticket system.


#5

Thanks. I don’t know where to do that. Could you post a link ?


#6

Discussion moved offline.