<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 閱讀(1789) | 評論 (8)編輯 收藏

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

    如題,我裝的是6.5的

    posted @ 2008-10-14 21:32 anyStar 閱讀(1611) | 評論 (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 閱讀(1656) | 評論 (3)編輯 收藏

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

    導航

    統計

    常用鏈接

    留言簿(2)

    隨筆分類

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 午夜亚洲国产成人不卡在线| 大地影院MV在线观看视频免费| 毛片在线免费视频| 日韩精品内射视频免费观看| 亚洲av片在线观看| 天天爽亚洲中文字幕| 无码久久精品国产亚洲Av影片| 亚洲国产精品成人| 国产免费131美女视频| 久久久久国产精品免费免费搜索 | 无码人妻精品中文字幕免费东京热| 一区二区三区AV高清免费波多| 亚洲国产乱码最新视频| 亚洲第一香蕉视频| 亚洲精品日韩专区silk| 亚洲视频在线观看网址| 亚洲天堂中文字幕在线观看| 亚洲黄色在线观看网站| 中文字幕无码精品亚洲资源网久久 | 亚洲一级毛片在线观| 亚洲一卡二卡三卡四卡无卡麻豆| 91亚洲性爱在线视频| 久久久久se色偷偷亚洲精品av| 亚洲综合色婷婷在线观看| 老妇激情毛片免费| 天黑黑影院在线观看视频高清免费| 最近中文字幕大全免费版在线| 99re热精品视频国产免费| 成年女人午夜毛片免费视频| 亚洲一级片内射网站在线观看| 亚洲乱码一区二区三区在线观看| 亚洲精品成人网站在线播放| 亚洲偷自精品三十六区| 一级成人a做片免费| 中字幕视频在线永久在线观看免费| 麻豆国产VA免费精品高清在线 | 可以免费看黄的网站| 国产亚洲精品国看不卡| 亚洲人配人种jizz| 久久久精品免费视频| 全免费a级毛片免费看不卡|