on 2014 Oct 22 1:33 PM
Could someone please tell me how can i check if there is an active connection to sybaseIQ? I would like to perform a check before sending statements so that I have a chance to re-establish the connection in case it was lost.
I am using sacapi.h, sacapidll.cpp, sacapidll.h (SQL Anywhere C API which is layered on top of the DBLIB package and it was implemented with Embedded SQL).
I don't think callbacks are supported. I can't find documentation on sqlany_register_callback in the SybaseIQ documentation
Request clarification before answering.
Hm, according to the v16 online docs, I stand corrected w.r.t. my statement the C API would not support a callback (I had just checked for v12.0.1, see my comment on the question):
Support for callbacks in the SQL Anywhere C API - Support for callbacks has been added to version 3 of the SQL Anywhere C API. The following function is now available when _SACAPI_VERSION is defined as 3.
sacapi_bool sqlany_register_callback( a_sqlany_connection * sqlany_conn, a_sqlany_callback_type index, SQLANY_CALLBACK_PARM callback );
This function can be used to register callback functions.
Note: That's what the docs say, I have not tested that myself...
And here's the whole story including a sample from the according CR note 738036 as released with v16.0.0.1522 and above, and these versions do contain an according sample "callback.cpp", too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
30 | |
8 | |
8 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.