您提到的教程中的一段代码:
<bean id="sessionFactory" > <property name="dataSource" ref="dataSource" /> <property name="configLocation"> <value>classpath:hibernate.cfg.xml</value> </property> <property name="configurationClass"> <value>org.hibernate.cfg.AnnotationConfiguration</value> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${jdbc.dialect}</prop> <prop key="hibernate.show_sql">true</prop> </props> </property></bean>这是指定hibernate.cfg.xml的地方,也是放置方言的地方。如果您有
<property name="dataSource"ref="dataSource" />会话工厂,则在hibernate.cfg.xml中不需要它。我建议再次查看该教程的源代码并相应地调整您的代码。



