oracle数据库:oracle数据库插入数据时异常

org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in com/land/landpermission/organ/sqlmap/LP_ORGAN_SQLMAP.xml. 
--- The error occurred while applying a parameter map. 
--- Check the ORGAN.insert-InlineParameterMap. 
--- Check the statement (update failed). 
--- Cause: java.sql.SQLException: ORA-00917: missing comma

Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in com/land/landpermission/organ/sqlmap/LP_ORGAN_SQLMAP.xml. 
--- The error occurred while applying a parameter map. 
--- Check the ORGAN.insert-InlineParameterMap. 
--- Check the statement (update failed). 
--- Cause: java.sql.SQLException: ORA-00917: missing comma

处理:

 1.检查sqlmap中的字段名是否与数据库中的字段名一致

    (检查发现在数据库中的email这段 在sqlmap中写成了emaill)

2.另外看看是不是建表是使用了oracle的关键字作为表的字段名。

3.有时在写sql语句时会多写或少些了一个","也会出现类似异常。

改完后要注意将bean 和action中的字段改成和数据库中的一致

Tags:  oracle数据库备份 oracle数据库教程 oracle创建数据库 oracle数据库

延伸阅读

最新评论

发表评论