BasicDataSource class of package org.apache.commons.dbcp

2003-12-17 Thread Jitesh Sinha
Hello all,

I am making use of BasicDataSource class to get connections .The code which
I write to get a connection is as follows :

basicDataSource = new BasicDataSource();
basicDataSource.setDefaultAutoCommit(autoCommit);
basicDataSource.setUrl(jdbcUrl);
basicDataSource.setDriverClassName(driver);
basicDataSource.setUsername(user);
basicDataSource.setPassword(password);
basicDataSource.setMaxIdle(maxIdle);
basicDataSource.setMaxActive(maxConn);

basicDataSource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
basicDataSource.setMaxWait(maxWait);
basicDataSource.setRemoveAbandoned(removeAbandoned);
basicDataSource.setLogAbandoned(logAbandoned);
basicDataSource.setValidationQuery(validationQuery);

Connection conn =basicDataSource.getConnection() ;

Does getConnection() method of BasicDataSource  create a new connection to
the database or internally manage some connection pool from which a new
connection is taken?
Will I need to write any extra code to make use of a connectionpool ?

Thanks,
Jitesh


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: BasicDataSource class of package org.apache.commons.dbcp

2003-12-17 Thread Jitesh Sinha
No friends for me on this list ! :(

-Original Message-
From: Jitesh Sinha [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 3:12 PM
To: Struts Users Mailing List
Subject: BasicDataSource class of package org.apache.commons.dbcp


Hello all,

I am making use of BasicDataSource class to get connections .The code which
I write to get a connection is as follows :

basicDataSource = new BasicDataSource();
basicDataSource.setDefaultAutoCommit(autoCommit);
basicDataSource.setUrl(jdbcUrl);
basicDataSource.setDriverClassName(driver);
basicDataSource.setUsername(user);
basicDataSource.setPassword(password);
basicDataSource.setMaxIdle(maxIdle);
basicDataSource.setMaxActive(maxConn);

basicDataSource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
basicDataSource.setMaxWait(maxWait);
basicDataSource.setRemoveAbandoned(removeAbandoned);
basicDataSource.setLogAbandoned(logAbandoned);
basicDataSource.setValidationQuery(validationQuery);

Connection conn =basicDataSource.getConnection() ;

Does getConnection() method of BasicDataSource  create a new connection to
the database or internally manage some connection pool from which a new
connection is taken?
Will I need to write any extra code to make use of a connectionpool ?

Thanks,
Jitesh


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: BasicDataSource class of package org.apache.commons.dbcp

2003-12-17 Thread Ben Janes

Hi,

I used a connection pool via JNDI,, the only issue was that it was possible for the 
system to check
out the same connection once, and if you return one, (close) then it closes for them 
all.. I wrote a
little item that added the hashcode to an arraylist, removeing it when then code 
released the
connection, when there where none in the arraylist it was safe to close

Benjamin A. Janes

BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [OT ]BasicDataSource class of package org.apache.commons.dbcp

2003-12-17 Thread chekuri raju
hello jitesh,
 
why do u need to bother about  BasicDataSource  code if u r running it on any server 
just configure  the configuration files and use JNDI lookup to get the connection and 
your close() on Connection object returns the con obj to pool
 
regards
srinivas

Jitesh Sinha [EMAIL PROTECTED] wrote:
No friends for me on this list ! :(

-Original Message-
From: Jitesh Sinha [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 3:12 PM
To: Struts Users Mailing List
Subject: BasicDataSource class of package org.apache.commons.dbcp


Hello all,

I am making use of BasicDataSource class to get connections .The code which
I write to get a connection is as follows :

basicDataSource = new BasicDataSource();
basicDataSource.setDefaultAutoCommit(autoCommit);
basicDataSource.setUrl(jdbcUrl);
basicDataSource.setDriverClassName(driver);
basicDataSource.setUsername(user);
basicDataSource.setPassword(password);
basicDataSource.setMaxIdle(maxIdle);
basicDataSource.setMaxActive(maxConn);

basicDataSource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
basicDataSource.setMaxWait(maxWait);
basicDataSource.setRemoveAbandoned(removeAbandoned);
basicDataSource.setLogAbandoned(logAbandoned);
basicDataSource.setValidationQuery(validationQuery);

Connection conn =basicDataSource.getConnection() ;

Does getConnection() method of BasicDataSource create a new connection to
the database or internally manage some connection pool from which a new
connection is taken?
Will I need to write any extra code to make use of a connectionpool ?

Thanks,
Jitesh


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

RE: [OT ]BasicDataSource class of package org.apache.commons.dbcp

2003-12-17 Thread Jitesh Sinha
Thanks Chekuri and Ben for your replies...meanwhile I have done some
research on BasicDataSource
and found a few things..will post once I am totally sure about that...

-Original Message-
From: chekuri raju [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 7:49 PM
To: Struts Users Mailing List
Subject: RE: [OT ]BasicDataSource class of package
org.apache.commons.dbcp


hello jitesh,

why do u need to bother about  BasicDataSource  code if u r running it on
any server just configure  the configuration files and use JNDI lookup to
get the connection and your close() on Connection object returns the con obj
to pool

regards
srinivas

Jitesh Sinha [EMAIL PROTECTED] wrote:
No friends for me on this list ! :(

-Original Message-
From: Jitesh Sinha [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 3:12 PM
To: Struts Users Mailing List
Subject: BasicDataSource class of package org.apache.commons.dbcp


Hello all,

I am making use of BasicDataSource class to get connections .The code which
I write to get a connection is as follows :

basicDataSource = new BasicDataSource();
basicDataSource.setDefaultAutoCommit(autoCommit);
basicDataSource.setUrl(jdbcUrl);
basicDataSource.setDriverClassName(driver);
basicDataSource.setUsername(user);
basicDataSource.setPassword(password);
basicDataSource.setMaxIdle(maxIdle);
basicDataSource.setMaxActive(maxConn);

basicDataSource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
basicDataSource.setMaxWait(maxWait);
basicDataSource.setRemoveAbandoned(removeAbandoned);
basicDataSource.setLogAbandoned(logAbandoned);
basicDataSource.setValidationQuery(validationQuery);

Connection conn =basicDataSource.getConnection() ;

Does getConnection() method of BasicDataSource create a new connection to
the database or internally manage some connection pool from which a new
connection is taken?
Will I need to write any extra code to make use of a connectionpool ?

Thanks,
Jitesh


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
Do you Yahoo!?
Free Pop-Up Blocker - Get it now


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]