Drupal database connection Is it necessary to connect to drupal database in order to fetch something from database? OR no if I have drupal installed so no need to make connection in any template file in order to fetch data?
The database connection is handled elsewhere, you do not need to write a new connection function in your template file.  

You can use this:
https://api.drupal.org/api/drupal/includes!database!database.inc/function/db_query/7