Fixed the bug when generating the uri of database.