Hi Manjunath,
It could be a possibility that the output of the connection function has changed as the product has evolved from BO 6.5 to BO 4.1.
Check the output first and then you can tweak the above logic and extract the database name.
Regards,
Yuvraj