-->
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: hibernate-3.2.1.ga examples eg/org/hibernate/auction problem
PostPosted: Mon Dec 04, 2006 6:12 pm 
Newbie

Joined: Mon Dec 04, 2006 5:44 pm
Posts: 2
I am new to hibernate. Recently, I am trying to learn hibernate.

I am trying to run hibernate-3.2.1.ga examples eg/org/hibernate/auction, however I have the following problems.

13:41:17,643 INFO HbmBinder:300 - Mapping class: org.hibernate.auction.User -> AuctionUser
13:41:17,643 DEBUG HbmBinder:1270 - Mapped property: id -> id
13:41:17,643 DEBUG HbmBinder:1270 - Mapped property: userName -> userName
13:41:17,737 WARN UserSuppliedConnectionProvider:23 - No connection properties specified - the user must supply JDBC connections
Exception in thread "main" org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:409)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:119)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1289)
at org.hibernate.auction.Main.main(Main.java:368)

The environment I used to run the example is following:
1. Lomboz 3.2 with the following jar files with the following classpath:
antlr.jar,cglib.jar,asm.jar,asm-attrs.jars,commons-collections.jar,commons-logging.jar, hibernate3.jar,jta.jar,dom4j.jar,log4j.jar,mysql-connector.jar
2. I didnot create table for User, Bid and AuctionItem. I use MySQL Server 5.0 as my databases, and I am not sure where I can config the database' name. In my application, I need to use the name as "Test".
3. I tried to run the org\hibernate\auction\Main.java as a standalone application in Lomboz (Eclipse).
4. I copied log4j.properties and hibernate.cfg.xml in the root of class path, and no hibernate.properties.

5. hibernate.cfg.xml as following:
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="connection.url">jdbc:hsqldb:hsql://localhost</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>

<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">create</property>

<mapping resource="events/Event.hbm.xml"/>
<mapping resource="events/Person.hbm.xml"/>

</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 5:05 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Follow these steps: http://www.hibernate.org/Documentation/GettingStarted

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 15, 2007 2:14 am 
Newbie

Joined: Sun Apr 15, 2007 2:10 am
Posts: 1
I had the same problem, referencing older documentation like Hibernate In Action. It seems the property name was changed to "hibernate.dialect". That's what the code says at least.


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.