How do i integrate Login functionality inside a custom component with Joomla database.

You should use following code

$result = JFactory::getApplication()->login(array('username'=>$username, 'password'=>$password));

You have to produce a form with fields account information. And want to some URL in in form action.