TC 3.3.x has a variable-replacement option, which is very nice for this sort
of thing.  Unfortunately, it hasn't been ported to TC 4.x.

"Mohamed Tagari" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Is there any way of taking the password and username for connecting to a
> database out of the server.xml, and placing it in code before the lookup
> is done on this?? As having the username and password as plain text is not
> very secure..
>
> // java code
> Context init = new InitialContext();
> Context ctx = (Context) init.lookup("java:comp/env");
> DataSource ds = (DataSource) ctx.lookup("jdbc/myoracle");
>
>
>
> // extract from server.xml
> <Resource name="jdbc/myoracle" auth="Container"
>               type="javax.sql.DataSource"/>
>
> <ResourceParams name="jdbc/myoracle">
>     .
>     .
>     .
>   <parameter>
>     <name>username</name>
>     <value>scott</value>
>   </parameter>
>   <parameter>
>     <name>password</name>
>     <value>tiger</value>
>   </parameter>
>     .
>     .
> </ResourceParams>
>
> mo




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to