selected is dbhandle and selected db