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

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

    如題,我裝的是6.5的

    posted @ 2008-10-14 21:32 anyStar 閱讀(1608) | 評論 (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 閱讀(1651) | 評論 (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 閱讀(1600) | 評論 (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 閱讀(277) | 評論 (0)編輯 收藏

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

    導航

    統計

    常用鏈接

    留言簿(2)

    隨筆分類

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 成人免费福利视频| 97在线免费视频| 特级做A爰片毛片免费69| 久久精品亚洲综合专区| 黄色片免费在线观看| 午夜影视日本亚洲欧洲精品一区| 免费萌白酱国产一区二区三区| 久久久久亚洲精品美女| 久久这里只精品国产免费10| 久久久久久亚洲Av无码精品专口| 免费A级毛片无码专区| 亚洲毛片无码专区亚洲乱| 99无码人妻一区二区三区免费| 亚洲午夜无码毛片av久久京东热| 成人毛片免费观看视频| 国产成人亚洲综合无| 亚洲午夜国产片在线观看| 日韩电影免费观看| 亚洲图片校园春色| 国产精品自在自线免费观看| 国产黄片不卡免费| 亚洲美女视频免费| 成人看的午夜免费毛片| 色多多免费视频观看区一区| 亚洲乱码一区二区三区在线观看| 午夜视频在线免费观看| 91亚洲国产成人久久精品| 国产真人无遮挡作爱免费视频 | 亚洲精品午夜无码专区| 久久九九AV免费精品| 亚洲综合国产成人丁香五月激情 | AV免费网址在线观看| 阿v视频免费在线观看| 亚洲福利视频导航| 国内大片在线免费看| 99久久精品毛片免费播放| 亚洲午夜精品在线| 亚洲精品国产V片在线观看| 6080午夜一级毛片免费看6080夜福利 | AV在线亚洲男人的天堂| 在线观看免费视频资源|