Hi,

I am using org.apache.commons.dbcp.BasicDataSource to implement a
connection pooling and this is my class.

 

import javax.sql.DataSource;

import org.apache.commons.dbcp.BasicDataSource;

 

public class DBPool

{

            public DataSource getDataSource()

            {

                    BasicDataSource ds = new BasicDataSource();

        ds.setDriverClassName("driver");

        ds.setUsername("user");

        ds.setPassword("pwd");

        ds.setUrl("url");

        ds.setMaxActive(10);

        ds.setMaxWait(5000);

        return ds;

    }

}

 

And in the classes where I need database connection, I am saying 

DBPool dbPool = new DBPool();

dbPool.getDataSource();

 

By doing this, my application is getting slower. Initially I configured
db connection in the struts-config.xml file and it was working fast at
that time.

 

Any ways for me to improve the performance and speed?

 

Uma

Reply via email to