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

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

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

    2008年8月7日

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

    運行servlet為什么總提示找不到文件

    我在Tomcat中文件路徑配置如下:webapps\servlet\WEB-INF\classes

    目錄下有一個TestServlet.class文件


    web.xml文件配置如下:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
              http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
               version="2.4">
      <servlet>
        <servlet-name>TestServlet</servlet-name>
        <servlet-class>servlet.TestServlet</servlet-class>      
      </servlet>
      <servlet-mapping>
        <servlet-name>TestServlet</servlet-name>
        <url-pattern>/TestServlet</url-pattern>
      </servlet-mapping>
    </web-app>


    本人愚昧,整了將近一個小時仍然沒搞定,希望高手幫助一下

     

    posted @ 2008-08-11 17:33 anyStar 閱讀(1605) | 評論 (4)編輯 收藏

    學習中要注意的知識點及總結

    1,<meta>標簽是什么意思
    2.掌握JSP各種對象及其方法
    3.JSP對象所具有的相同的方法,及其用法區別
    4.迭代器使用的注意事項



    1--    meta其實是html語言head區的一個輔助性標簽。
             meta標簽共有兩個屬性,它們分別是http-equiv屬性和name屬性,不同的屬性又有不同的參數值,這些不同的參數值就實現了不同的網頁功能。  
              1、name屬性   
      name屬性主要用于描述網頁,與之對應的屬性值為content,content中的內容主要是便于搜索引擎機器人查找信息和分類信息用的。    
         2、http-equiv屬性     
      http-equiv顧名思義,相當于http的文件頭作用,它可以向瀏覽器傳回一些有用的信息,以幫助正確和精確地顯示網頁內容,與之對應的屬性值為content,content中的內容其實就是各個參數的變量值。

    2--  九種對象:request,response,out,seasion,pageContent,exception,application,config,page

    3--  待整理。。

    4--  在聲明迭代器之后,容器的大小是不能再改變的,否則會出錯。要想改變容器大小,應在聲明Iterator對象之前。

    posted @ 2008-08-07 16:45 anyStar 閱讀(283) | 評論 (0)編輯 收藏

    <2008年8月>
    272829303112
    3456789
    10111213141516
    17181920212223
    24252627282930
    31123456

    導航

    統計

    常用鏈接

    留言簿(2)

    隨筆分類

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲熟妇无码av另类vr影视| 中文字幕亚洲综合久久| 亚洲综合无码无在线观看| **真实毛片免费观看| 久久久久亚洲AV无码麻豆| 人妻在线日韩免费视频| a毛片免费在线观看| 99久久综合国产精品免费| 亚洲欧洲日产国码www| 伊人久久免费视频| 久久国产亚洲高清观看| 亚洲w码欧洲s码免费| 日本免费一本天堂在线| 亚洲av无码有乱码在线观看| 成人在线免费观看| 免费人成大片在线观看播放电影 | 久久久无码精品亚洲日韩蜜桃| 亚洲综合一区国产精品| 日韩精品无码人妻免费视频| 国产精品亚洲综合天堂夜夜| 亚洲国产综合久久天堂| 美女视频黄的免费视频网页| 亚洲国产精品专区| 免费无码不卡视频在线观看| 亚洲欧洲国产精品久久| 国产片AV片永久免费观看| 亚洲免费网站观看视频| 99在线视频免费| 亚洲中文无码卡通动漫野外| 亚洲精品WWW久久久久久| 国产色爽免费无码视频| 亚洲人成网站在线观看播放青青| 永久免费毛片手机版在线看| 一级做a爱过程免费视频高清| 亚洲专区在线视频| 午夜毛片不卡高清免费| 亚洲六月丁香六月婷婷蜜芽| 国产午夜免费福利红片| 亚洲日本VA中文字幕久久道具| 可以免费观看一级毛片黄a| 777爽死你无码免费看一二区|