Hello group! I am developing a system using JSP, Java Beans and a MySQL database. The Bean talks to the database, and I was wondering what the best way is to set up the connections to the db? I was also wondering if anyone knows what happens when two people access the same jsp page at the same time - do they get to separate instances of the bean?? Will this cause any problems for my bean in regards to having two requests using the same connection simultaneously? Thanks a lot! /Tomas
The best way to set up connections is with a connection pool. The number of users sharing a JavaBean depends on the scope you assign the bean in the useBean tag. The choices are page, request, session and application. Bill
What will be the problems if i don't use connection pool.. pls tell me the points.. Pranit..
Joined: Jan 14, 2002
Thank you all for your answers! >What will be the problems if i don't use connection pool.. pls tell me the points.. You have to be careful so you don't have two users using the same connection simultaneously (that was my main concern, and this could happen if you do it the wrong way). But the biggest pro with connection pooling is efficiency as you don't have to create a new connection for every request - you simply reuse them from the pool. Hope this is correct, Tomas
Hi, any body can sujest good resource, where can i find good and nice explanation about implimentation of Connection Pooling using JSP. I am using Professional JSP from WROX publications regards sripad
Sripad, I can suggest a very good book called Core Servlets and Java Server Pages by Marty Hall. Their is a website for the book at Core JSP and their is also source code from the chapter on database connection pooling at Jsp/servlet code. I hope this helps and best of luck.