当'hibernate.dialect'未设置hibernate4 tomcat7时,连接不能为空

当'hibernate.dialect'未设置hibernate4 tomcat7时,连接不能为空,第1张

当'hibernate.dialect'未设置hibernate4 tomcat7时,连接不能为空

您提到的教程中的一段代码

    <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中不需要它。我建议再次查看该教程的源代码并相应地调整您的代码。



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/4934535.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-13
下一篇2022-11-12

发表评论

登录后才能评论

评论列表(0条)

    保存