try to query database from C code.