Hibernate中报错:’hibernate.dialect’ must be set when no Connection avalable

Hibernate中报错:Caused by: org.hibernate.HibernateException: ‘hibernate.dialect’ must be set when no Connection available

解决办法:
在applicationContent.xml中的hibernate配置中加入mySQL5的方言属性:

<bean id=“sessionFactory”

class=“org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean”>

<property name=“dataSource” ref=“dataSource” />

<property name=“packagesToScan”>

<list>

<value>com.huayadai.appkeeper.orm</value>

</list>

</property>

<property name=“hibernateProperties”>

<value>hibernate.dialect=org.hibernate.dialect.MySQL5Dialect</value>

</property>

</bean>

分享到: 更多 (0)