WSAD5 with Hibernate
有]有人在WSAD5中用^Hibernate阿t
我了好Lrgo有e`o不知道l能我。
I just have a Web Project, and inside the Java Source, I have a java class Cat.java (setter/getter), and a servlet (calling Hibernate Configure to get session), I have tried to put hibernate.cfg.xml file to each directory(WEB-INF/classes, WEB-INF, Java Source, ...), but all do not work at all, I don't know why, do you know where the .cfg.xml need to be put? Or do I need to have the .cfg.xml file path in web.xml? I have no idea.
Do you have an example about creating a web application using WSAD5 and Hibernate?
Thanks so much for helps.
The error message is:
_______________________________________________________
" I net.sf.hibernate.cfg.Configuration Configuration resource: /hibernate.cfg.xml
7bff0b53 Configuration W net.sf.hibernate.cfg.Configuration /hibernate.cfg.xml not found
7bff0b53 WebGroup E SRVE0026E: [Servlet Error]-[/hibernate.cfg.xml not found]: net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
"
_______________________________________________________
hibernate.cfg.xml
_______________________________________________________
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"> />
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">COM.ibm.db2.jdbc.net.DB2Driver</property>
<property name="hibernate.connection.url">jdbc:db2:JDO</property>
<property name="hibernate.connection.username">admin</property>
<property name="hibernate.connection.password">admin</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="dialect">net.sf.hibernate.dialect.DB2Dialect</property>
<!-- Mapping files -->
<mapping resource="Cat.hbm.xml"/>
</session-factory>
</hibernate-configuration>
______________________________________________________
我了好Lrgo有e`o不知道l能我。
I just have a Web Project, and inside the Java Source, I have a java class Cat.java (setter/getter), and a servlet (calling Hibernate Configure to get session), I have tried to put hibernate.cfg.xml file to each directory(WEB-INF/classes, WEB-INF, Java Source, ...), but all do not work at all, I don't know why, do you know where the .cfg.xml need to be put? Or do I need to have the .cfg.xml file path in web.xml? I have no idea.
Do you have an example about creating a web application using WSAD5 and Hibernate?
Thanks so much for helps.
The error message is:
_______________________________________________________
" I net.sf.hibernate.cfg.Configuration Configuration resource: /hibernate.cfg.xml
7bff0b53 Configuration W net.sf.hibernate.cfg.Configuration /hibernate.cfg.xml not found
7bff0b53 WebGroup E SRVE0026E: [Servlet Error]-[/hibernate.cfg.xml not found]: net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
"
_______________________________________________________
hibernate.cfg.xml
_______________________________________________________
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"> />
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">COM.ibm.db2.jdbc.net.DB2Driver</property>
<property name="hibernate.connection.url">jdbc:db2:JDO</property>
<property name="hibernate.connection.username">admin</property>
<property name="hibernate.connection.password">admin</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="dialect">net.sf.hibernate.dialect.DB2Dialect</property>
<!-- Mapping files -->
<mapping resource="Cat.hbm.xml"/>
</session-factory>
</hibernate-configuration>
______________________________________________________
相關文章
- wsad5入門 (轉)
- Hibernate SQL方言 (hibernate.dialect)SQL
- Hibernate學習:初識hibernate
- Hibernate框架框架
- hibernate(七) hibernate中查詢方式詳解
- 手寫 Hibernate ORM 框架 00-hibernate 簡介ORM框架
- hibernate詳解
- Hibernate填坑
- Hibernate 查詢
- Hibernate配置OracleOracle
- hibernate-sqlSQL
- Hibernate 框架理解框架
- Hibernate--Criteria
- Hibernate--元件元件
- Hibernate flush理解
- HIbernate errors...Error
- structs+hibernateStruct
- Stateless SessionBean + Hibernate?SessionBean
- 【Hibernate】—Hibernate+mysql 環境搭建+入門例項MySql
- hibernate(五) hibernate一對一關係對映詳解
- Hibernate-ORM:13.Hibernate中的連線查詢ORM
- Hibernate(二):Hibernate搭建開發環境+簡單例項開發環境單例
- 關於hibernate的hibernate.hbm2ddl.auto屬性
- Hibernate物件狀態物件
- hibernate詳解一
- Hibernate框架簡介⑤框架
- Hibernate框架簡介④框架
- Hibernate框架簡介③框架
- Hibernate框架簡介②框架
- Hibernate框架簡介①框架
- Hibernate框架學習框架
- Hibernate的基礎
- Spring 整合 HibernateSpring
- Hibernate之DetachedCriteria、Criteria
- 【hibernate】Session快取Session快取
- Hibernate查詢方式
- hibernate 元件對映元件
- hibernate list和iterate