项目中遇到错误如下:
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/xx/xxx/xxx.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the queryChannelTableRows.
--- Check the SQL statement.
--- Cause: java.util.NoSuchElementException
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:204)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)
一开始的时候被误导了,以为是其他地方有问题。后来才发现,是因为在xml中的查询语句,要使用v$视图。
$和#都是特殊字符,后来总是找到相关信息:
Both # and $ can be escaped by doubling: ## or $$ respectively.
测试通过。
参考URL如下:
http://www.iteye.com/topic/309164