Iam developing a product which can be deployed on any web or application server. As different application or web servers have different lookup mechanisms for getting a connection object from the connection pool.
I want to know the server details on which my application is deployed, so that i can use server specific lookup mechanism.
Currently i am working on two servers. ( Weblogic9.2 and Tomcat5.5 ). Can these servers be recognized from my java application using any API.
I have done a hard look up at google, but i could not find a solution.
Please help me.
Thanks, Venkat [ October 05, 2008: Message edited by: Venkata Guru ]
Instead of coding to different servers, I'd use JNDI as the lookup mechanism. (Here's a tutorial on how to code that for a DataSource.) Then you can configure it in the web.xml for each server - no code changes needed.
I see. You can still write platform-independent code by keeping those parameters in the web.xml file as context parameters. Then this JNDI code can check for whether or not they're present, and use or not use the Hashtable accordingly.