tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan" <iva...@abac.com>
Subject Re: Properties + jdbc
Date Thu, 19 Apr 2001 22:54:07 GMT
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" <rbertucelli@fr.st>
To: <tomcat-user@jakarta.apache.org>
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.
>


Mime
View raw message