You can create context parameters in the web.xml file as such:

<context-param>
    <param-name>LOGIN_NAME</param-name>
    <param-value>sa</param-value>
</context-param>

and then access them in code like this:

ServletContext ctx = getServletContext();
String loginname = ctx.GetInitParameter(LOGIN_NAME);

Hope this helps

Ivan

----- Original Message -----
From: "Romain Bertucelli" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 19, 2001 7:08 AM
Subject: Properties + jdbc


> Hi all,
>
> I'm begining working with Tomcat and servlets and I've heard that jdbc
> parameters (jdbc url, login, passwd) should be set in a .properties file.
>
> My question :  How do I get these parameters in my DataBaseAccess Class (I
> mean, with which method) ?
>
> Thanks in advance,
>
> Romain.
>

Reply via email to