Added support for selecting database