You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jose Euclides da Silva Junior - DATAPREVRJ <Jo...@rj.previdenciasocial.gov.br> on 2003/10/09 23:58:43 UTC

Still needing help with DBCP - slow response time

Hi,
i am still having problems with DBCP 1.0 - TomCat 4.18.
Some hints:
1 - I didnt setted the server.xml up.
2 - I am using the Oracle Thin Driver
3 - I ve created my own  connection pooling class, called BeanPoolConn,
which returns a datasource object. See below the main statement:

      DriverAdapterCPDS cpds = new DriverAdapterCPDS();
      cpds.setDriver("oracle.jdbc.driver.OracleDriver");
      cpds.setUrl("jdbc:oracle:thin:@uxrjo038:1526:drj1");
      cpds.setUser("PORTAL_PRATICA");
      cpds.setPassword("PORTAL_PRATICA00");
      Jdbc2PoolDataSource tds = new Jdbc2PoolDataSource();
      tds.setConnectionPoolDataSource(cpds);
      tds.setDefaultMaxActive(10);
      tds.setDefaultMaxWait(50);
      tds.getConnection();
      ds = tds;
      return ds; 

4 -  My main class instances this BeanPoolConn class:

             if ( ds == null )
                {
                   BeanPoolConn bp = new BeanPoolConn();
                   ds = bp.conexao();
                }
             con = ds.getConnection();    
	... do something...
	pstmt = con.prepareStatement(query);
            resultcount = pstmt.executeUpdate();

Question: Is it enough? Are there others steps to be done?   
Thanks again, Euclides.

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


Re: Still needing help with DBCP - slow response time

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 10/09/2003 11:58 PM Jose Euclides da Silva Junior - DATAPREVRJ wrote:
> Hi,
> i am still having problems with DBCP 1.0 - TomCat 4.18.
> Some hints:
> 1 - I didnt setted the server.xml up.
> 2 - I am using the Oracle Thin Driver
> 3 - I ve created my own  connection pooling class, called BeanPoolConn,
> which returns a datasource object. See below the main statement:
> 
>       DriverAdapterCPDS cpds = new DriverAdapterCPDS();
>       cpds.setDriver("oracle.jdbc.driver.OracleDriver");
>       cpds.setUrl("jdbc:oracle:thin:@uxrjo038:1526:drj1");
>       cpds.setUser("PORTAL_PRATICA");
>       cpds.setPassword("PORTAL_PRATICA00");
>       Jdbc2PoolDataSource tds = new Jdbc2PoolDataSource();
>       tds.setConnectionPoolDataSource(cpds);
>       tds.setDefaultMaxActive(10);
>       tds.setDefaultMaxWait(50);
>       tds.getConnection();
>       ds = tds;
>       return ds; 
> 
> 4 -  My main class instances this BeanPoolConn class:
> 
>              if ( ds == null )
>                 {
>                    BeanPoolConn bp = new BeanPoolConn();
>                    ds = bp.conexao();
>                 }
>              con = ds.getConnection();    
> 	... do something...
> 	pstmt = con.prepareStatement(query);
>             resultcount = pstmt.executeUpdate();
> 
> Question: Is it enough? Are there others steps to be done?   
> Thanks again, Euclides.

Hi Euclides,
if you are making a custom connection pool with DBCP, you would get a 
better response by mailing their users & developers on the commons 
mailing list.

Sounds interesting, but I can't help, sorry. What drives you to write a 
custom connection pool anyway? Have you got problems with the commons 
implementation?

Adam

-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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