cancel
Showing results for 
Search instead for 
Did you mean: 

What kind of version checking should be done for applications using SQLDBC

Former Member
0 Kudos

Hi,

This query is regarding the kind of version checking that an application should do.

Currently I am building my application in MaxDB version of 7.6.05.09, which is the community edition available on the sdn download site currently, this will change to the enterprise edition once we have finalized everything in terms of code and packging etc....

Now when the application is shipped to customer site, what kind of version checking should the application do to ensure that the version of library/kernel/client/sdk it has been built with is consistent with the one that is installed at the customer site.

From what i see SQLDBC exposes the following method for getting version related information.

char * SQLDBC_Environment_getLibraryVersion(SQLDBC_Environment* hdl);

char *getSDKVersion();

SQLDBC_Int4 SQLDBC_Statement_getKernelVersion(SQLDBC_Statement* hdl); (Note: Wondering why should a handle to SQLDBC_Statement be needed to find the Kernel version)

Just to give you little more hint of what i am talking about, for MySQL database we use the functions

mysql_get_client_version and mysql_get_server_version and check that the values returned by these functions are less than the value which was used at build time.

Regards

Raja

Accepted Solutions (1)

Accepted Solutions (1)

TTK
Employee
Employee
0 Kudos

Hello Raja

From the documentation:


const char* SQLDBC::SQLDBC_Environment::getLibraryVersion ()    

Returns the version of used SQLDBC runtime.

This is the version of the used SQLDBC library. The version of the loaded
runtime may differ from the version inidacted in the used header. It is our
aim that newer versions of the runtime will run with old applications without
the need to be re-compiling. 

Therefore, for compatibility checks, use getLibraryVersion.

getKernelVersion is also available from the connection:

SQLDBC_Connection::getKernelVersion()

Regards Thomas

Former Member
0 Kudos

Hi Thomas,

Thanks for the very valuable information.

So, just to reconfirm the understanding. The compile time version can be the value mentioned in SQLDBC_C.h file in the following line, i.e., 70603 :

#define SQLDBC_CHeaderVersion "SQLDBC_C.H 7.6.3 BUILD 015-121-173-107"

A check should be made during runtime to ensure that '70603 should be always less than or equal to the value returned by the call to SQLDBC_Environment_getLibraryVersion().

Please confirm this. Also i am thinking if it is necessary to do a similar check for the KernelVersion just to ensure that the application is not being run in kernel version lower than what it was tested for. What do you say ?

Regards

Raja

TTK
Employee
Employee
0 Kudos

Hello Raja

FYI, SQLDBC guaranties binary compatability for higher versions. I.e. if you compile with 7.6, using SQLDBC 7.7 should work out of the box. Is this the issue you want to solve?

Doing the kernel version check as you mentioned sounds ok.

Regards Thomas

Former Member
0 Kudos

In way yes. I am trying to protect my application from giving undiagnosable errors when it runs into SQLDBC library which are of lower version the one in which it was compiled. For example if i compile with 7.6.3 and then application is run on SQLDBC library version say 7.6.0 then my application should throw a error and come out instead of running and later running into difficult problems.

Same way for the server version also.

Regards

Raj

Answers (0)