db.c to access remote db