new code for accessing db from c++
more changes