Hi Kirtika,
I do not rule out the possibility of that through a tweak/hack, but I suppose the workflow for such a connection setup is common in a production and staging environment where you have two 'similar' setup of database. In such setup, you may need to use ArcMap on the ArcGIS for Server machine(aka app server) to author your map document to connect to the actual database you need to reach from and publish from there.
Let us know if such workflow is possible for you.
Cheers,
Raymond