hibernate錯誤
錯誤1.
Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/workspace/MLDN2/WebRoot/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
把hibernate里的ehcache.xml拷貝到src目錄下,hibernate3用到了ehcache
錯誤2.
在使用hql進行操作的時候,表名要和類名一致,否則會出現(xiàn)table is not mapping的錯誤
錯誤3.
database product name cannot be null 是因為在得到config的時候沒有在后面加.config()造成的
Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update?? 因為Hibernate Tools(或者Eclipse本身的Database Explorer)生成*.hbn.xml工具中包含有catalog="***"(*表示數(shù)據(jù)庫名稱)這樣的屬性,將該屬性刪除就可以了
使用hql語句的時候,在select n.content from Newsvo? n where n.id=?的問號的位置是從0開始記數(shù)的.
錯誤4.
在使用Hibernate中,is not mapped 是hql語句中的表名首字母要大寫
No value specified for parameter錯誤的原因少了pstmt.setInt(1, id);
錯誤5.
用hibernate自動生成的save方法,進行保存的時候,報了org.hibernate.exception.SQLGrammarException: could not insert table: 發(fā)現(xiàn)是因為表中創(chuàng)建了與關鍵字相同的字段group,修改之后就可以進行插入操作
[img][/img]
錯誤1.
Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/workspace/MLDN2/WebRoot/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
把hibernate里的ehcache.xml拷貝到src目錄下,hibernate3用到了ehcache
錯誤2.
在使用hql進行操作的時候,表名要和類名一致,否則會出現(xiàn)table is not mapping的錯誤
錯誤3.
database product name cannot be null 是因為在得到config的時候沒有在后面加.config()造成的
Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update?? 因為Hibernate Tools(或者Eclipse本身的Database Explorer)生成*.hbn.xml工具中包含有catalog="***"(*表示數(shù)據(jù)庫名稱)這樣的屬性,將該屬性刪除就可以了
使用hql語句的時候,在select n.content from Newsvo? n where n.id=?的問號的位置是從0開始記數(shù)的.
錯誤4.
在使用Hibernate中,is not mapped 是hql語句中的表名首字母要大寫
No value specified for parameter錯誤的原因少了pstmt.setInt(1, id);
錯誤5.
用hibernate自動生成的save方法,進行保存的時候,報了org.hibernate.exception.SQLGrammarException: could not insert table: 發(fā)現(xiàn)是因為表中創(chuàng)建了與關鍵字相同的字段group,修改之后就可以進行插入操作
更多文章、技術交流、商務合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
