Hi everybody,
I am developing a website involving sevlets and an access
database.The UI is created using HTML.
I am implementing Connection Pooling in that.
I store a certain no. of connections(in a var. limit) in a vector and keep
track of the number of users(in a var. users).Once the number of users
exceeds the limit(users>limit)I increase the limit by adding one more
connection to the vector.
I have set the initial value for limit as 2 and that of users as 0.
When I try to access the servlet from two browsers simultaneously,and the
value for users is 2,I get the following error:
Error: 500
Internal Servlet Error:
java.lang.ArrayIndexOutOfBoundsException: 2 >= 2
at java.util.Vector.elementAt(Compiled Code)
at db1servlet.doPost(Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at
com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:140)
at com.sun.web.core.InvokerServlet.service(InvokerServlet.java:169)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at
com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:140)
at com.sun.web.core.Context.handleRequest(Context.java:375)
at com.sun.web.server.ConnectionHandler.run(Compiled Code)
Can anybody tell me what is causing this problem?
Secondly,what is the default capacity of a vector?
Thanks in advance.
Vaijayanthi.
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
___________________________________________________________________________
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