users@glassfish.java.net

Config and change DB connectivity params run time

From: <glassfish_at_javadesktop.org>
Date: Thu, 27 Nov 2008 21:47:26 PST

Hi,

I am creating simple web service that will connect SQL sever database with user name and password and execute a stored proc, I am using prepareStatement

My question is where I should keep below parameters to make my DB connectivity, I wan to access them run time, so that I can change the config file to move from test to Prod DB when I need

-------
DRIVER_CLASS_NAME
DB_URL
DB_USERNAME
DB_PASSWORD
--------

What is the standard in JEE, like in .NET we know web.config file do that where we can put those run time and can access easily

What is the equivalent in JEE, please reply
[Message sent by forum member 'shafi77' (shafi77)]

http://forums.java.net/jive/thread.jspa?messageID=319083