Don't create db connection in every .jsp file. Create a controller servlet which puts a connection
pool into the servlet context and reference that from your jsps through the application object.
Derek
Shunxiang Yang wrote:
> Hi,
> I've developed a web site using Linux + mysql + apache + tomcat3.1 + jsp + jdk1.2.2.
And the machine is: 733Mhz, 256M RAM. But the performance is not ideal. In fact, both the
.html files and .jsp files are slow. Can tomcat + apache work well when visitors number of
the web site increases? How to make it work fine? Would you please give me some advice?
> BTW, can resin do better than tomcat?
> In almost every .jsp files, I create a db connection and do some queries, and then
destroy it by calling close() method. I think this is not a good design. But how can I do
db connection pooling using apache + tomcat + mysql?
>
> Thank you very much for your help!
>
> best wishes,
> yours,
> Shunxiang Yang
|