• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Standalone Connection pooling with DBCP

 
Mona Tajik
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,

I'm trying to create a db connection pooling for standalone application using DBCP but I'm not sure if it is possible for DBCP to have different connection pool.

I have successfully created a single pool (i.e. 1 datasource for 1 pool) but I need to create different pool since I will be connecting to different database. I need to connect to this database real time since the database names will be based on generated date and user criteria.

Does DBCP has pool manager where it manages several connection pool or do I have to create a singleton class to manage several pool of connections?

Thanks.
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DBCP allows you to create several connection pools, but yes, you have to manage access to these pools yourself.
In their standalone example, the DBCP team suggests that you use JNDI.

Regards, Jan
 
Mona Tajik
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jan for the info.
 
Mona Tajik
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is another example to use DBCP pooling for standalone application DBCP Datasource.

One can also just redirect connection to database (i.e. dbname.tablename) when accessing data so you need not create another connection for different database.
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One can also just redirect connection to database (i.e. dbname.tablename) when accessing data so you need not create another connection for different database
.
Yes, if they are accessible from the same database instance, and with the same user account.
I did not understand that this was your goal.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic