Connection can be made to database in joomla by specifying database parameter information such as host,mysqlusername and mysql password into configuration file of joomla
What Vikas said is absolutely Correct. In Joomla there is no need to write the code for
database connectivityIf we hosted the site local into web, we have to change the configuration.php
fileIn that we have to mention the database username and password details.
CheersRegards,Sathish