1

I need to get address of my connection (I don't know exact name of it but it is number with 'i' char), when I want to connect to server in kdb process I just use function:

q) h: hopen`:localhost:5000:username:password
q) h
5i

and then I know that my connection number is 5. How to get this number with kx.c library? Creating connection:

 c = new c(url,port,username:password);

I can do execute any statement but I have no idea what is name of the connection in this case. Is is possible to get this number with kx.c library?

Thomas Smyth - Treliant
  • 4,993
  • 6
  • 25
  • 36
dusiu
  • 31
  • 5

1 Answers1

1

There's self-contained examples of kdb/java here: http://www.timestored.com/kdb-guides/kdb-java-api

and then I know that my connection number is 5. How to get this number with kx.c library?

If you call .z.w from java that will return your handle number. Though I don't see what you could possibly use that for.

Ryan Hamilton
  • 2,601
  • 16
  • 17
  • My bad, let me explain what I want to do, and maybe we will find the way how to solve this problem. So I have 2 rdb and 2 hdb process, and there is gateway process which is getting data from whatever source it is (no matter it is rdb nr 1 or hdb nr 2), to get this data I use hopen function and it looks like (neg .z.w)(myFunc();.z.w[] but since I use java I should use function c.ks(), but there is problem that this function didn't return anything, all I can do is to c.k("") and make sure that my asynchronous query is done, but how to get information from c.ks()? – dusiu Nov 22 '16 at 16:49
  • ks is an asynchronous call - it won't wait for a response. Depending on how your gateway is written, it will either hold the result for you to retrieve (using k to get from an agreed location), or it will issue a call to you with the result. There's no way to tell which from the information provided. The owner of the gateway will be able to tell you the appropriate way to interact with it. – user2242865 Nov 22 '16 at 23:31