You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark <ma...@libero.it> on 2002/12/19 01:14:29 UTC
Digester - Config.xml - datasource
Hello
I'm wondering whether anyone has every used digester to read in properties
from config.xml and then addSetProperty to change a couple of values..
E.g.
<data-source key="mykey" jism="jism" username="frank" password="butcher" />
Now I want to make a connection to pretty much the same db etc.. Has anyone
tried.
Digester newdatasource = new Digester();
newdatasource . addObjectCreate("datasources/datasource", "DataSource");
newdatasource
.AddSetProperty("struts-config/datasources/datasource/setproperty","key","my
key²);
newdatasource
.AddSetProperty("struts-config/datasources/datasource/setproperty","username
","ricky²);
newdatasource
.AddSetProperty("struts-config/datasources/datasource/setproperty","password
","bianca²);
//Some means of reading in the properties that I don¹t want to change, but I
haven¹t found yet.. Etc
Javax.sql.DataSource ds = getDatasource(³mykey²);
Will this work?
Has anyone done this.,
Many thanks in advance and seasonal felicitations
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
FW: Digester - Config.xml - datasource
Posted by Mark <ma...@libero.it>.
Sorry people, but I could do with some feedback on this rather than finding
out the hard way.. Up up against the wire I I want to get my flight back
home for christmas..
Anyone done this? Is my question silly (would be the first time)?
Many thanks
mark
------ Forwarded Message
From: Mark <ma...@libero.it>
Reply-To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Date: Thu, 19 Dec 2002 01:14:29 +0100
To: Struts Users Mailing List <st...@jakarta.apache.org>
Subject: Digester - Config.xml - datasource
Hello
I'm wondering whether anyone has every used digester to read in properties
from config.xml and then addSetProperty to change a couple of values..
E.g.
<data-source key="mykey" jism="jism" username="frank" password="butcher" />
Now I want to make a connection to pretty much the same db etc.. Has anyone
tried.
Digester newdatasource = new Digester();
newdatasource . addObjectCreate("datasources/datasource", "DataSource");
newdatasource
.AddSetProperty("struts-config/datasources/datasource/setproperty","key","my
key²);
newdatasource
.AddSetProperty("struts-config/datasources/datasource/setproperty","username
","ricky²);
newdatasource
.AddSetProperty("struts-config/datasources/datasource/setproperty","password
","bianca²);
//Some means of reading in the properties that I don¹t want to change, but I
haven¹t found yet.. Etc
Javax.sql.DataSource ds = getDatasource(³mykey²);
Will this work?
Has anyone done this.,
Many thanks in advance and seasonal felicitations
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
------ End of Forwarded Message
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>