我借着眼光探讨了这个议题,并看到了一些最佳做法。 但我需要一些具体的建议。 我正在准备一份J2EE仪器,该仪器从JP s处向DAO提供。 因此,这是各种东西。 大部分数据都是通过存储程序进行的,由iBatis ORM/Spring提出。 有时,在SP一侧发生错误时,它将向用户传递一个简单的信息,例如:
javax.servlet.ServletException: org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in debtowed.xml.
--- The error occurred while applying a parameter map.
--- Check the debtowed.getFormerTenantData.
--- Check the statement (update procedure failed).
--- Cause: java.sql.SQLException: ORA-06550: line 1, column 11:
PLS-00905: object package.GET_FORMER_ADDRESS is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Caused by: java.sql.SQLException: ORA-06550: line 1, column 11:
PLS-00905: object package.GET_FORMER_ADDRESS is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
At this point the above information is displayed in the browser and logged to server.log.
However, I want to do following:
- Present user with custom error page
- log the errors in myapp.log instead of server.log (we do this in some other places as we use log4j)
les告诉我,这样做的最佳方式是什么? 我是否应在网上添加一些内容? 就像听众一样? 这将是唯一的变化,还是我必须修改现行法典?
该法典没有检查任何错误。 它只是说下面的SP。
getSqlMapClientTemplate().queryForList("sp.getfmrAddy", paramMap);