How to find the current database?

Dear Frienz,

Iam using two databases in my application and how to find the current database name? Also how to find the existance of a database?

I have option to change the database? so if a user gives a database name how do i can check whether the database already exists or not?

Thanks in advance

Regards, Jose Marin