File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes SessionFactory and database product name Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "SessionFactory and database product name Error" Watch "SessionFactory and database product name Error" New topic
Author

SessionFactory and database product name Error

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
Hi all,

I am new to Hibernate and am trying to set it up with tomcat and Mysql.

The database product name cannot be null is being generate when i am calling
SessionFactory factory = Configuration().setProperties(System.getProperties()).buildSessionFactory();

In my hibernate.cfg.xml i have dialect set to "org.hibernate.MySQLDialect"

Any help appreciated
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
just a guess:
you also need:
<property name = "hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name = "hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name = "hibernate.connection.url">jdbc:mysql://localhost/xxx</property>
<property name = "hibernate.connection.username">xxx</property>
<property name = "hibernate.connection.password">xxx</property>


java amateur
david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
Thank you for the reply but I have included those properties as well.

Any other ideas

Thank you

David
Ryan Chiu
Greenhorn

Joined: Jun 21, 2005
Posts: 5
Hi, hope this will help ...
I had tried http://www.onjava.com/lpt/a/4386 online sample, and I got "database product name cannot be null", but I tried to rename my hibernate.properties to hibernate.properties.old, I still got this error message, so I guess maybe hibernate cann't find hibernate.properties. And then I move hibernate.properties to /src/hibernate.properties, and everything is ok. So maybe you should try to put hibernate.properties the right folder.
Sorry, I am not advanced user, but I try to help.

Ryan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SessionFactory and database product name Error