cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Parolini" <t...@employer.com.br>
Subject RE: Turbine without ESQL
Date Wed, 06 Jun 2001 18:54:51 GMT
> > > Can somebody just send me a fragment
> > > of code, which gets connections from
> > > Turbine pool?

Yep...

<Snip of my code>
import org.apache.turbine.services.db.PoolBrokerService;
import org.apache.turbine.util.db.pool.DBConnection;
import org.apache.turbine.services.resources.TurbineResourceService ;

static PoolBrokerService pool = PoolBrokerService.getInstance(); // Turbine
pool of connections
private Connection Conn = null ;  // Connection
private DBConnection db = null;		// Pooled connection

try {
TurbineResourceService.setPropertiesFileName("C:/jakarta-tomcat-3.2.1/webapp
s/tl/pool/TurbineResources.properties") ;
} catch (IOException ioexp) {
	DebugPrint("IO error:" + ioexp.getMessage() ) ;
}

db = pool.getConnection();
Conn = db.getConnection();

</Snip of my code>

This is what you want.

Remember to have turbine-pool.jar in you servlet lib folder.

You can see that I'm using the TurbineRessouces.properties to set the
pooling conf, you could do it using the standard java Property class.

HTH.

- Tony


---------------------------------------------------------------------
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