cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Luzyanin <i...@ProZa.Lviv.UA>
Subject Re: How to access jdbc datasource in cocoon.xconf from Cocoon actions
Date Fri, 12 Apr 2002 18:24:08 GMT
I know HOW! :)

//---------------------
ComponentSelector selector =
        (ComponentSelector) manager.lookup(Roles.DB_CONNECTION);
DataSourceComponent datasource = (DataSourceComponent)
selector.select("my_pool");
//---------------------


Thanx to Thomas von Schwerdtner!

On Fri, 2002-04-12 at 16:02, ME wrote:
> Hi!
> 
> The question is: 
> How i can use jdbc datasource defined in cocoon.xconf in my Cocoon
> action class ?
> 
> Example:
> //--------------- cocoon.xconf --------------------
> <jdbc name="my_pool">
> 	<pool-controller min="5" max="10"/>
> 	<dburl>jdbc:mysql:///test</dburl>
> 	<user>test</user>
> 	<password/>
> </jdbc>
> 
> //----------------- TestAction.java ----------------
> public class TestAction extends AbstractAction
> {
> 	public Map act(Redirector redirector,
> 				   SourceResolver resolver,
> 				   Map objectModel,
> 				   String source,
> 				   Parameters params)
> 	{
> 		// Here i would like to get some info from datasource
> 		// 'my_pool'... But i don't know HOW :( !
> 	}
> }
> //------------------------------------------
> 
> And one more thing. Where can i get Cocoon javadoc??? Does one exist???
> 
> (RH Linux 7.2, Cocoon 2.0.2, Tomcat 3.3.1, JDK 1.3.1_02b-FCS Blackdown)
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message