You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Philippe Van Der Gucht <ph...@uniway.be> on 2003/03/12 11:15:19 UTC

Using dbpc package in struts 1.0

Hello,

I would like to use the dbpc package 
(http://jakarta.apache.org/commons/dbcp/index.html) in our struts 1.0 application.

Has somebody here already done this?
If so, what are the issues involved?


Greetings,
Philippe.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Using dbpc package in struts 1.0

Posted by Philippe Van Der Gucht <ph...@uniway.be>.
Thank you so much, it works beautifully. :-)

(we needed dbpc for the connection failover capability)

Mark Lowe wrote:
> It use the BasicDataSource rather than the older deprecated struts 
> GenericDataSource its more a case of the xml sytaax changing the config.xml
> 
> 
>     <data-source type="org.apache.commons.dbcp.BasicDataSource" 
> key="strutsConnection">
>             <set-property property="defaultAutoCommit" value="false"/>
>             <set-property property="driverClassName" 
> value="com.mysql.jdbc.Driver"/>
>             <set-property property="url" value="jdbc:mysql://etc"/>
>             <set-property property="maxActive" value="4"/>
>             <set-property property="username" value="arse"/>
>             <set-property property="password" value="bandit"/>
>             <set-property property="maxWait" value="5000"/>
>     </data-source>
> 
> To do this in java rather than the ds being addedas on object in the 
> action servlet context .. This example does the same as the xml
> 
> BasicDataSource dataSource = new BasicDataSource();
>     
> dataSource.setDefaultAutoCommit(false);
> dataSource.setUsername("arse");
> dataSource.setPassword("bandit");
> dataSource.setDriverClassName ("com.mysql.jdbc.Driver");
> dataSource.setUrl("jdbc:mysql://etc");
> dataSource.setMaxActive(2);
> 
>                
> context.setAttribute("myNewDataSource",dataSource);
> 
> 
> hope this helps mark
> 
> 
> Mercoledì, 12 mar 2003, alle 11:23 Europe/Rome, Gemes Tibor ha scritto:
> 
>> Philippe Van Der Gucht wrote:
>>
>>> Hello,
>>>
>>> I would like to use the dbpc package 
>>> (http://jakarta.apache.org/commons/dbcp/index.html) in our struts 1.0 
>>> application.
>>>
>>> Has somebody here already done this?
>>> If so, what are the issues involved?



-- 
Tel: +32-27179265


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Using dbpc package in struts 1.0

Posted by Mark Lowe <ml...@officinedigitali.it>.
It use the BasicDataSource rather than the older deprecated struts 
GenericDataSource its more a case of the xml sytaax changing the 
config.xml


	<data-source type="org.apache.commons.dbcp.BasicDataSource" 
key="strutsConnection">
			<set-property property="defaultAutoCommit" value="false"/>
			<set-property property="driverClassName" 
value="com.mysql.jdbc.Driver"/>
			<set-property property="url" value="jdbc:mysql://etc"/>
			<set-property property="maxActive" value="4"/>
			<set-property property="username" value="arse"/>
			<set-property property="password" value="bandit"/>
			<set-property property="maxWait" value="5000"/>
	</data-source>

To do this in java rather than the ds being addedas on object in the 
action servlet context .. This example does the same as the xml

BasicDataSource dataSource = new BasicDataSource();
	
dataSource.setDefaultAutoCommit(false);
dataSource.setUsername("arse");
dataSource.setPassword("bandit");
dataSource.setDriverClassName ("com.mysql.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://etc");
dataSource.setMaxActive(2);

				
context.setAttribute("myNewDataSource",dataSource);


hope this helps mark


Mercoledì, 12 mar 2003, alle 11:23 Europe/Rome, Gemes Tibor ha scritto:

> Philippe Van Der Gucht wrote:
>
>> Hello,
>>
>> I would like to use the dbpc package 
>> (http://jakarta.apache.org/commons/dbcp/index.html) in our struts 1.0 
>> application.
>>
>> Has somebody here already done this?
>> If so, what are the issues involved?
>
> Struts 1.0 has a db connection pool implementation included as well. 
> Why
> don't you use it?
>
> Tib
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Using dbpc package in struts 1.0

Posted by Gemes Tibor <ti...@i-trade.hu>.
Philippe Van Der Gucht wrote:

> Hello,
>
> I would like to use the dbpc package 
> (http://jakarta.apache.org/commons/dbcp/index.html) in our struts 1.0 
> application.
>
> Has somebody here already done this?
> If so, what are the issues involved?

Struts 1.0 has a db connection pool implementation included as well. Why
don't you use it?

Tib




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org