<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    2008年10月14日

    hibernate新手求助!!

    今天下午學習使用hibernate,跟著視頻做,可是控制臺老報這個錯誤
    02:03:12,171  WARN UserSuppliedConnectionProvider:23 - No connection properties specified - the user must supply JDBC connections
    02:03:12,171 ERROR SchemaExport:202 - schema export unsuccessful
    java.lang.UnsupportedOperationException: The user must supply a JDBC connection
     at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:30)
     at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:28)
     at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180)
     at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
     at com.test.hibernate.ExportDB.main(ExportDB.java:15)

    視頻就能運行成功,我的就不行,很是郁悶,

    hibernate.cfg.xml配置如下:
            

                <!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.url ">jdbc:mysql:///localhost/hibernate_first</property>
                      <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
                      <property name="hibernate.connection.username">root</property>
                      <property name="hibernate.connection.password">root</property>
                      <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
      
                      <mapping resource="com/test/hibernate/User.hbm.xml"/>
                 </session-factory>
            </hibernate-configuration>

    實體類User的映射文件配置:
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
     "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
     "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
     <class name="com.test.hibernate.User">
      <id name="id">
       <generator class="uuid"/>
      </id>
      
      <property name="userName"/>
      <property name="password"/>
      <property name="createDate"/>
      <property name="expireDate"/>
     </class>
     
    </hibernate-mapping>

    下面是連接數據庫的類:

    package com.test.hibernate;

    import org.hibernate.cfg.Configuration;
    import org.hibernate.tool.hbm2ddl.SchemaExport;

    public class ExportDB {


     public static void main(String[] args) {
      
      Configuration cfg = new Configuration().configure();
      
      SchemaExport export = new SchemaExport(cfg);
      
      export.create(true, true);
     }

    }


    希望路過高手不吝指導一下,感激不盡!!!!

    posted @ 2008-12-30 02:23 anyStar 閱讀(1782) | 評論 (8)編輯 收藏

    為什么我的myeclipse沒有創建Hibernate Mapping File的選項?

    如題,我裝的是6.5的

    posted @ 2008-10-14 21:32 anyStar 閱讀(1609) | 評論 (2)編輯 收藏

    <2008年10月>
    2829301234
    567891011
    12131415161718
    19202122232425
    2627282930311
    2345678

    導航

    統計

    常用鏈接

    留言簿(2)

    隨筆分類

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 免费人成激情视频| 免费一级毛片免费播放| 亚洲av午夜福利精品一区人妖| 免费人成视频在线播放| 九月婷婷亚洲综合在线| 一区二区三区视频免费| 青青草原亚洲视频| 免费毛片在线看不用播放器| 91麻豆国产自产在线观看亚洲| 国产在线观看无码免费视频| 亚洲AV无码乱码在线观看裸奔| 久久久久久久岛国免费播放| 亚洲精品乱码久久久久久下载| 99视频全部免费精品全部四虎| 久久久国产亚洲精品| 亚洲Av无码国产情品久久| 国产特黄一级一片免费| 亚洲国产精品热久久| 免费福利网站在线观看| 老子影院午夜伦不卡亚洲| 亚洲免费视频一区二区三区| 国产啪精品视频网站免费尤物| 亚洲精品免费在线视频| 国产网站免费观看| a在线观看免费视频| 亚洲性线免费观看视频成熟| 亚洲国产精品无码久久青草| 免费播放在线日本感人片| 亚洲国产综合精品| 国产一区在线观看免费| 好猛好深好爽好硬免费视频| 亚洲国产超清无码专区| 亚洲毛片av日韩av无码| 日本高清在线免费| 一级特黄色毛片免费看| 亚洲精品中文字幕乱码| 成人亚洲综合天堂| 亚洲免费福利视频| 成人特级毛片69免费观看| 4444亚洲国产成人精品| 免费国产高清视频|