Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection pooling using hibernate and struts1.3

 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I am learning struts with hibernates. I want to implement connection pooling.

I wrote the configuration code in a java class, when ever I want a connection I am creating an instance for that class in my bean class and getting a session factory object. From that I am creating a session object and persisting the data to database. I am using c3p0 connection pooling. The sample code looks like this
Is the approach right? Can anyone guide me. Thank you all in advance. Have a good day.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A small change to the Connection classIs this the right approach?
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me is this approach right or wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic