Hi,
I'm trying to set up a simple test project to use Hibernate with a table in out exisitng MS SQL database, but I get an exception with the message "database product name cannot be null".
I have the config file for Hibernate set up with the correct values. The code seems to be failing at the Configuration's buildsessionfactory() method.
Could someone pls tell me why this might be happening?
Thanks.
the config file is shown below
Code:
<?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>
<property name="hibernate.connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
<property name="hibernate.connection.url">jdbc:microsoft:sqlserver://28XC381RIZWAN\UHMINSTANCE:1433;DatabaseName=uhm</property>
<property name="hibernate.connection.username">uhm</property>
<property name="hibernate.connection.password">123</property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JDBCTransactionFactory
</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.HashtableCacheProvider
</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping resource="Patient.hbm.xml"/>
</session-factory>
</hibernate-configuration>