File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes C3p0/Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "C3p0/Hibernate" Watch "C3p0/Hibernate" New topic


Jamie Lee

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
author & internet detective

Joined: May 26, 2003
Posts: 33117

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

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jamie Lee

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

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

Joined: Jan 31, 2007
Posts: 17
Thanks, Paul!
I agree. Here's the link:
subject: C3p0/Hibernate
It's not a secret anymore!