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

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

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

    2008年9月18日

    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)編輯 收藏

    jstl的配置

    1.到http://archive.apache.org/dist/jakarta/taglibs/standard/binaries/下載你所需的版本

    2.將jstl.jar和standard.jar拷貝到WEB-INF目錄下的lib文件里

    3.在WEB-INF目錄下新建一個tlds文件夾,將c.tld和c-rt.tld考進去

    4.在web.xml文件配置你所用到的標簽如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5"
     xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
     http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
     
    <taglib>
        <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
        <taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
    </taglib>

    <taglib>
        <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
        <taglib-location>/WEB-INF/tlds/c-rt.tld</taglib-location>
    </taglib>

    ........................
    </web-app>

     

    posted @ 2008-09-18 20:30 anyStar 閱讀(1652) | 評論 (3)編輯 收藏

    <2008年9月>
    31123456
    78910111213
    14151617181920
    21222324252627
    2829301234
    567891011

    導航

    統計

    常用鏈接

    留言簿(2)

    隨筆分類

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产精品怡红院永久免费| a级毛片免费全部播放无码| 无码国产精品一区二区免费式直播| 亚洲日韩中文字幕在线播放| 无码AV动漫精品一区二区免费| 又黄又爽的视频免费看| 免费看内射乌克兰女| 亚洲国产成人久久综合碰| 成年网站免费入口在线观看| 亚洲人妻av伦理| 国产美女视频免费观看的网站 | 蜜桃精品免费久久久久影院| 亚洲中文精品久久久久久不卡| 午夜一区二区免费视频| 日本亚洲中午字幕乱码| 亚洲av麻豆aⅴ无码电影| 久久久久久久久久久免费精品| 亚洲人成人无码网www电影首页| a级片免费观看视频| 亚洲高清免费在线观看| 青青久在线视频免费观看| 亚洲暴爽av人人爽日日碰| 亚洲精品在线视频| 日本在线免费观看| 亚洲人成人77777在线播放| 免费黄色一级毛片| 老司机精品免费视频| 久久久国产精品亚洲一区| 久久WWW免费人成人片| 男人和女人高潮免费网站| 久久精品国产亚洲av麻豆| 午夜国产精品免费观看 | 大片免费观看92在线视频线视频| 在线精品亚洲一区二区小说| 91av免费观看| 国产成人精品日本亚洲语音 | 国产免费久久精品99re丫y| 色天使色婷婷在线影院亚洲| 国产亚洲美女精品久久久久狼| 国产麻豆视频免费观看| a级毛片免费高清视频|