FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

JDBC question

 


umeshtangnu
I am currently making a website using java with tomcat

As anyone who has used tomcat/servlets knows, each java page gets called every time you run a new page. My problem is that i have a page which uses a database, and every time i run the page, it has to reconnect to the database. is there any way to make it so that the connection is "open", that is no matter how many times i go to this page, i never have to reconnect.

BTW, i am using postgresql and JDBC v.4
hunnyhiteshseth
Well although its quite sometime when the original poster requested the answer and by now most probably he would have got his answer but still i am giving a possible solution if somebody else need it.


Instead of calling a new servlet each time, use multithreading.
For each new request create a new thread. The main advantage of servlet over CGI is that servlet requires a new process but in servlet only new thread is required.[/code]
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.