wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 800

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: 800

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

Joined: Sep 15, 2009
Posts: 800

Can anyone tell me is this approach right or wrong.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Connection pooling using hibernate and struts1.3
 
Similar Threads
How to insert using hibernate?
glassfish vs. Hibernate: JNDI configuration
Hibernate Dialect for MS Access
Session creation falied - error
hibernate.cfg.xml problem on startup