-->
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.  [ 4 posts ] 
Author Message
 Post subject: Having problem in Hibernate config without using Ant
PostPosted: Thu Oct 20, 2005 7:56 am 
Newbie

Joined: Thu Oct 20, 2005 7:48 am
Posts: 19
org.hibernate.HibernateException: database product name cannot be null

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:374)

at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:110)

at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)

at customer.Main.main(Main.java:80)

Exception in thread "main"


This is my error while i make run this program.
my hibernate.cfg.xml is as below.
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>

<!-- Database connection settings -->
<property name="connection.driver_class">com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource</property>
<property name="connection.url">jdbc:sybase:Tds:sipl48:5000/Test</property>
<property name="connection.username">username</property>
<property name="connection.password">password</property>

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

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.SybaseDialect</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="customer/Customer.hbm.xml"/>

</session-factory>

</hibernate-configuration>

Still having problem please help...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 20, 2005 8:00 am 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
Hello,

are you sure Hib can see your hibernate.cfg.xml? I've had the same problem before and it was because it wasn't finding my file, but using a hibernate.properties it was finding instead.

_________________
Don't forget to rate if the post helped!


Top
 Profile  
 
 Post subject: Hi ,
PostPosted: Thu Oct 20, 2005 8:03 am 
Newbie

Joined: Thu Oct 20, 2005 7:48 am
Posts: 19
I have posted my Hibernate.cfg.xml and Customer.hmb.xml in root directory...
how u have done by hibernate.property..
please tell me if u have any idea...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 20, 2005 8:11 am 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
Here goes the content of my hibernate.properties. I'm using c3po connection pool and the database is Firebird, so you'll have to change it. Hope it helps:

Code:
## define query language constants / function names
hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'
## package imports
hibernate.query.imports net.sf.hibernate.test, net.sf.hibernate.eg

#Firebird
hibernate.dialect org.hibernate.dialect.FirebirdDialect
hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver
hibernate.connection.url jdbc:firebirdsql:127.0.0.1/3050:auge
hibernate.connection.username sysdba
hibernate.connection.password mypassword
hibernate.connection.lc_ctype ISO8859_1

###########################
### C3P0 Connection Pool###
###########################

hibernate.c3p0.max_size 2
hibernate.c3p0.min_size 2
hibernate.c3p0.timeout 5000
hibernate.c3p0.max_statements 0
hibernate.c3p0.validate false

## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)

#hibernate.connection.provider_class net.sf.hibernate.connection.DriverManagerConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.DatasourceConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.C3P0ConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.DBCPConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.ProxoolConnectionProvider

#######################
### Transaction API ###
#######################

## the Transaction API abstracts application code from the underlying JTA or JDBC transactions

#hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory
#hibernate.transaction.factory_class net.sf.hibernate.transaction.JDBCTransactionFactory

## to use JTATransactionFactory with JCS caching, Hibernate must be able to obtain the JTA TransactionManager

#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.JBossTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WeblogicTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.OrionTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.ResinTransactionManagerLookup


#############################
### Miscellaneous Settings ###
##############################

## print all generated SQL to the console
hibernate.show_sql true

## set the maximum JDBC 2 batch size (a nonzero value enables batching)
hibernate.jdbc.batch_size 0

## use streams when writing binary types to / from JDBC
hibernate.jdbc.use_streams_for_binary true


Put it on your classpath, and see if it works. I have this one working just fine with Hibernate 3.

_________________
Don't forget to rate if the post helped!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.