• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org.hibernate. HibernateException: database product name cannot be null

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am building a small project,
learning hibernate, so i have my class People.java,
which maps the People table in the database,
I also have TestHibernate1.java, which does the main work,
and I have my 2 configuration files, in the same folder as the 2 previous java files,
hibernate.properties
and
People.hbm.xml
so I added all the needed libraries
and I know get this error: org.hibernate.HibernateException: database product name cannot be null
i now*
you have an idea where the problem might be ?
The database product name cannot be null is being generate when i am calling SessionFactory sessionFactory = config.buildSessionFactory();
In my hibernate.properties, i have dialect set to org.hibernate.dialect.OracleDialect
maybe i should call it hibernate.cfg.xml instead of hibernate.properties ?
 
ZHENYA ZHOU
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know!!

not:
new Configuration().buildSessionFactory();
please try:
new Configuration().config().buildSessionFactory();
 
ZHENYA ZHOU
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry!
please try:
new Configuration().configure().buildSessionFactory();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic