get cursor for db connection