| Author |
Connection pooling for different accounts
|
fedai gandjaliyev
Ranch Hand
Joined: Dec 05, 2005
Posts: 99
|
|
Hello! I was walking thru the net to get to know how to use connectiong pooling and I found some articles describing that process. All of them were basically done with servlets! All articles recommend to create a ConnectionPool object at the servlet initialization and it's good! But the constructor of the ConnectionPool object takes the url, username, password etc... As I understand the pool is created for one user only. I'm using an applet-servlet communication and the user supplies username and password and I'm not that good at connection pooling yet! So I need Connection pooling for different users! How should I create the ConnectionPool object in this case? Thank you very much, Feadi!
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26193
|
|
Feadi, Normally on a server side application, there is one database user that accesses the database on behalf of different users. If your users have separate accounts, the value of connection pooling is quite limited. A good alternate would be to create a connection on receiving the applet request and use it for all subsequent request before returning to the applet.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
fedai gandjaliyev
Ranch Hand
Joined: Dec 05, 2005
Posts: 99
|
|
But the servlet is going to be accessed by multiple users at the same time! Putting a new Thread class into the doGet() or doPost() method doesnt seem to work! Will HttpSession help in this case?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
|
Why would each of your users need their own database account? Are you confusing users of your web application with users of the database? They are almost always separate concepts.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
fedai gandjaliyev
Ranch Hand
Joined: Dec 05, 2005
Posts: 99
|
|
What I'm trying to deploy is a payment system! Only valid users can perform payment and the applet should verify if the user whicn logs into the database is a valid user and therefore can perform payment! This is why I have so many different accounts! All I need to do is to make so that the servlet, AuthenticationServlet in my case, can handle multiple requests at the same time in case of multiple users trying to connect to the database and send a response to the applet saying if the user is a valid one!
|
 |
 |
|
|
subject: Connection pooling for different accounts
|
|
|