-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Programmatically chosing Configuration?
PostPosted: Tue Sep 09, 2003 3:08 pm 
Newbie

Joined: Fri Sep 05, 2003 10:30 am
Posts: 17
Location: Texas
I want to use Hibernate's ability to provide a JDBC connection. I'm looking through Chapter 2 SessionFactory Configuration section 2.6 XML Configuration File in the online reference.
http://www.hibernate.org/hib_docs/refer ... ation.html

I have all jar files for the Hibernate 1.2.5 distributable in my WSAD lib folder and they've been imported to the project. The examples do not seem to work. Take the two examples provided:

Code:
import cirrus.hibernate.cfg.Configuration;

SessionFactory sf = new Configuration().configure().buildSessionFactory();
SessionFactory sf =
   Configuration.configure(
   "catdb.cfg.xml"
   ).buildSessionFactory();


Configuration appears to be a helper class with no visible constructor, and configure() does not take a string argument.

What am I doing wrong? How do I setup my codebase so that Hibernate-aware objects can do their own configuration management?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2003 10:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
The current version of Hibernate is 2.0.3. The code example works in that version!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 11, 2003 11:46 am 
Newbie

Joined: Fri Sep 05, 2003 10:30 am
Posts: 17
Location: Texas
Doh! So it does... ;-) thx!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.