my dog learned polymorphism*
The moose likes Object Relational Mapping and the fly likes Connection pooling using hibernate and struts1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Connection pooling using hibernate and struts1.3" Watch "Connection pooling using hibernate and struts1.3" New topic
Author

Connection pooling using hibernate and struts1.3

chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

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.


Love all, trust a few, do wrong to none.
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

A small change to the Connection classIs this the right approach?
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

Can anyone tell me is this approach right or wrong.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection pooling using hibernate and struts1.3