Hello again Biswanath,
Inserting pages that contain a db connection should not be a problem so long as the Alfresco virtual-tomcat instance has physical connectivity to the database you intend to query. It should really be as simple as dropping them into Alfresco and then testing it out.
One thing to keep in mind though when working with Databases and ANY web content management solution is how you intend to handle the virtualization aspect of the database. If your database contains global values that will not change from content developer to content developer, then there really is not much of an issue. However, if you intend each content developer to work in his or her own space, with their own copy of the data, you have more to consider. To seperate user "Frank" from user "Sarah" on the database side of the house, both Frank and Sarah's sandboxes would need to be pointed at an instance of the database that only Frank or Sarah (respectively) can modify. This would then follow the sandbox/transparency paradigm that Alfresco has built into their product.
To summarize, whenever a database is used in conjuction with the WCM assets generated inside a WCM tool, thought must be given to how to virtualize that database along with the virtualization of each sandbox.
I hope this helps some. If you have any questions, or if I have been unclear, please respond!
Brent Kastner
Eye Street