You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tony <to...@employer.com.br> on 2001/05/11 22:05:15 UTC
Turbine in my own code
Hi all,
Cocoon 1.8.2
I'm trying to use Turbine connection pooling in my own code(not using esql
taglib). But the example code given on the site dosen't work for me.
I'm using DB2 v7.0
Those lines:
-------------
import java.sql.*; // JDBC - Database access
import org.apache.turbine.util.db.pool.*;
[...]
static DBBroker pool = (DBBroker) DBBroker.getInstance(); // Gives a
compile error without the type casting
-------
gives me a
java.lang.ExceptionInInitializerError: java.lang.ClassCastException:
org.apache.turbine.services.db.PoolBrokerService
In my cocoon property:
# These are your database settings, look in the
# org.apache.turbine.util.db.pool.* package for more information.
processor.xsp.pool.database.default.driver=COM.ibm.db2.jdbc.app.DB2Driver
processor.xsp.pool.database.default.url=jdbc:db2:TL
processor.xsp.pool.database.default.username=TONY
processor.xsp.pool.database.default.password=mypass
processor.xsp.pool.database.default.maxConnections=5
processor.xsp.pool.database.default.expiryTime=3600000
Could someone give my a sample code that implement this turbine connection
pool ?
Kind regards,
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: Turbine in my own code
Posted by Tony <to...@employer.com.br>.
Ok..
After looking at the Cocoon code ( should have done it before thus), my code
now is:
------------
static PoolBrokerService pool = PoolBrokerService.getInstance()
private DBConnection db = null;
private Connection m_Conn = null ;
TurbineResourceService.setPropertiesFileName("C:/TurbineResources.properties
");
db = pool.getConnection();
m_Conn = db.getConnection();
--------------
I use the turbineResources.properties file to define my db connection:
database.default.driver=COM.ibm.db2.jdbc.app.DB2Driver
database.default.url=jdbc:db2:TL
database.default.username=TONY
database.default.password=sillycow
database.adaptor.DBDB2App=COM.ibm.db2.jdbc.app.DB2Driver
but i get a type COM.ibm.db2.jdbc.app.DB2Driver not implemented..
Help!
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>