This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes C3p0/Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "C3p0/Hibernate" Watch "C3p0/Hibernate" New topic
Author

C3p0/Hibernate

Jamie Lee
Greenhorn

Joined: Jan 31, 2007
Posts: 17
Hello everyone,

Does anyone have any experience working with c3p0 & Hibernate? I don't even know where to start - there's lots of examples on how to configure c3p0 with Hibernate, but nothing on how to actually start using the connection pool...I'd like to test using threads, but I have no idea how to start on that either. Does anyone have any sample code/tutorial links/advice??

Thanks so much!!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

Jamie,
Have you seen what Hibernate has to say about this? It looks pretty detailed.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jamie Lee
Greenhorn

Joined: Jan 31, 2007
Posts: 17
Thanks for the reply, but that's still only configuration information. I know how to configure c3p0, just not how to start using the pool...
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You start using the pool by asking your DataSource for a Connection. Simple as that. When it comes to Hibernate you don't even need to do that, just open a session and load an object. Behind the scenes Hibernate will be using the connection pool.
[ February 09, 2007: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jamie Lee
Greenhorn

Joined: Jan 31, 2007
Posts: 17
Thanks, Paul!
 
 
subject: C3p0/Hibernate
 
Similar Threads
HowTo configure the C3P0 properties in hibernateconfig.xml
Tomcat error --> org.hibernate.exception.JDBCConnectionException: Cannot open connection
java.net.SocketException MESSAGE: Broken pipe
Hibernate C3P0 connection pool provider
Hibernate Swallowing Connection Exceptions