分享一个用struts2+Hibernate3写的注册登录的页面
学完了Hibernate就把以前写的Struts2注册登录的改为了S2H的,可谓困难重重啊,本来想先不做了后来在@chenssy 的支持与指导下,终于完成了,遇到的最“大”的一个BUG是
org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Could not execute JDBC batch update; bad SQL grammar [insert into cms_cnparts.dbo.T_LINK (linkName, typeID, linkUrl, picture, linkIntro, createTime, email, tel, isPass, orderID, memberID, linkID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; nested exception is java.sql.BatchUpdateException: ORA-00926: missing VALUES keyword Caused by: java.sql.BatchUpdateException: ORA-00926: missing VALUES keyword at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459) at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
类似这样的,本来以为是HQL语言写错了,结果看了一晚上都是正确的,到网上搜了搜(http://hups.blog.sohu.com/84285595.html),原来Myesclipse在生成users.hdb.xml将catalog="***"(*表示数据库名称)这样的属性自动添加了,将该属性删除就可以了!