question about Struts2 and JDBC
843842Jun 9 2009 — edited Jun 10 2009Hello 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!