Ibrahim HIDIR wrote:
> thanks for help, it looks like working, but in fact i don't use
> servlet, and i have different users and passwords and databases
> (oracle, mysql, mssql, pgsql) i need to connect all of them same time
> with different users and pass , so if there is no session in my page,
> i need to keep my connections, so the connection pooling must work
> like a service all the time until i shutdown appserver...
If you use the appserver, you automatically use servlets. Every URL that
you access automatically creates a servlet.
If you instantiate the DBPool in the base class for all servlets
(usually something like "SitePage"), it will be only instantiated once
and will be available for all servlets until the appserver is shut down.
Instead of creating one DBPool, you can create as many DBPools as you
like: One for oracle, one for mysql, one for pgsql etc. Just give them
different names. Each pool can have a different size. So if you use
oracle more often than mysql, make the oracle DBPool larger.