Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

question about Struts2 and JDBC

843842Jun 9 2009 — edited Jun 10 2009
Hello guys I'm developing a webshop in struts2 and this is only a school work so I have to make the persistence with the old JDBC.

I have a question/problem about the implementation and I could explain it by describing my UserDB class. As you already figured out, this class persist a user and methods from this class are also used when Users log in to the system. The UserDB class creates a new connection every time it works with the database, and that is of course not a good solution since creating a connection is heavy! instead I would like to create a class with a pool of connection, and this class would hand out one of its free connection object to the the UserDB class or what ever class which needs it. Yeahh you get the point guys!

So my question is how this class with the connection pool could be available/instanced for my Struts2 webshop classes?

/with this said, Thanks in regards!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2009
Added on Jun 9 2009
2 comments
181 views