Hi Vijay, If you make real application do not copy j2ee tutorial. For a tutorial one DB connection is enough.
Fei Li ----- Original Message ----- From: "vijay" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 24, 2002 5:46 PM Subject: j2ee and database connection > > Hi, > > i've a few doubts about ServletContext & HttpSessionContext. In the j2ee > tutorial, i've noticed a example where a class(BookDB) is deployed as event > listener which implements ServletContext. and other servlet in the > application are using the same class BookDB. BookDB creates a (one) database > connection and has a few methods. > > My question is, if that application has only one connection, then what if > 1000 users access the application at a time? > I'm assuming ServletContext means it's the scope when ever a particular > servlet is deployed r started. > > If 1000 users invoke a servlet at the same time then the event listener > creates 1000 instances of BookDB class or only one which is shared by 1000 > users? if it is only one, then can we specify the number of connections to > open in the event listener class? > How connection pooling works in J2EE? > > is it a right way to create a db connection in HttpSessionContext scope? > > > Please advice..or let me know where can i find the neccessary info.. > > Thanks in advance.. > > Vijay > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html