Added database selection support.