No, not inside the form library. The web service needs to be built on a server where InfoPath can access it, such as on the SharePoint server itself.
The DB _has_ to be in a shared location that is accessible to InfoPath and the users using InfoPath (permissions).