开发技术:关于变量、移动以及含义(7)

文章作者 100test 发表时间 2007:03:14 13:47:11
来源 100Test.Com百考试题网


lets now address a situation in which your code has handled an error that was anticipated and likely caused by user input. simply displaying the oracle error message or, worse, allowing the exception to go unhandled, resulting in a display of the error stack, will not do. so, yes, you should "translate" the generic ora-0001 or ora-1403 information and the like into more-cuddly communications that achieve the following objectives:

next steps

read more about
log errors
oracle database data warehousing guide
oracle database pl/sql packages and types reference

bulk collect, forall, and save exceptions

  • notify the user that an error has occurred. you surely do not want to "swallow" errors.

  • the error message should explain the problem in terms the user can understand. from a security standpoint, you should not display the oracle error code or message. instead, display a message that explains in application-specific terms what has happened. this usually entails providing context-specific values, such as the name of the column that was being set to null or was involved in the duplicate index error.

  • where appropriate, tell the user what to do to address the problem (if a "retry" makes sense). you might say, "change the name of the account to a value that is not currently being used in the database" or "adjust the birthday of the employee so that the employee is at least 18 years old."

相关文章


在Oracle9i中计算时间差
ORACLE常用的SQL语法和数据对象(二)
分析Oracle数据库日志文件(一)
开发技术:关于变量、移动以及含义(6)
开发技术:关于变量、移动以及含义(7)
ORACLE认证基础:ORACLE系统概述(3)
开发技术:关于变量、移动以及含义(4)
ORACLE认证基础:ORACLE系统概述(1)
开发技术:关于变量、移动以及含义(2)
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛