在Eclipse中创建Hibernate项目时显示错误 [英] Error shown when creating Hibernate project in Eclipse

查看:79
本文介绍了在Eclipse中创建Hibernate项目时显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在学习hibernate.我正在尝试在eclipse中的hibernate上创建一个项目.在hibernate.cfg.xml中,它显示警告..流不可用"

Currently I am learning hibernate.I am trying to create a project on hibernate in eclipse.In hibernate.cfg.xml, it shows warning.."stream not available"

hibernate.cfg.xml:

hibernate.cfg.xml:

  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE hibernate-configuration PUBLIC
 "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
 <hibernate-configuration>
  <session-factory name="studentFactory">
    <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="connection.url">jdbc:mysql://localhost/nithya</property>
    <property name="connection.username">root</property>
    <property name="connection.password">root</property>
    <property name="connection.pool_size">5</property>   
    <property name="dialect">org.hibernate.dialect.mysqlDialect</property>  
    <property name="show_sql">false</property>
    <property name="hbm2ddl.auto">update</property>
    <mapping resource="\com\\xmls\\Student.hbm.xml" />
 </session-factory>

警告线是... " http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd>

the warning line is... "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

任何人都可以帮助我克服它,并提出学习和创建休眠项目的最佳方法. 在此先感谢.

anybody help me to overcome it and also suggest best ways to learn and create hibernate projects.. Thanks in advance..

推荐答案

在您的hibernate.cfg.xml中使用它

Use this in your hibernate.cfg.xml

   <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

代替

    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

这篇关于在Eclipse中创建Hibernate项目时显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆