06-27-2010
11,728,
1,345
Join Date: Feb 2004
Last Activity: 8 May 2020, 9:07 AM EDT
Location: NM
Posts: 11,728
Thanks Given: 903
Thanked 1,345 Times in 1,201 Posts
Yes, you can use dlopen, dlsym, and so on. It just adds a lot more code.
You need to declare common functions - like maybe cursor open, cursor fetch as function pointers.
The real problem is that database apps often use a lot of variable and structs that are peculiar to one db flavor or another, and I cannot say if they will cause problems.
Consider writing a base module that does your operations as a set of very simple operations: update table, open cursor. Then write two sets of basic db intefaces that supply the functions. Link in the interface you want for each machine.
That way your business logic is in a single module, which is what you want.