FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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]
Related topics
I Have a question . Is it the server support Chinese?
Question before requesting free hosting
question abt posts/mth
Kinda dumb question regarding DNS
A question
UT2004 U like the game? Do u have any question post here.
Question about DNS!
Question about Domain!
another uni.cc question
Question
Question abt lang. support...
question!!!!!!
A question about Naruto
C++ Question
Reply to topic    Frihost Forum Index -> Scripting -> Others

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