--=======================================
各种常见java.sql.SQLException归纳
java.sql.SQLException错误,将英文原文一并列出,以供查阅!
ORA-00904: --invalid column name 无效列名
ORA-00942: --table or view does not exist 表或者视图不存在
ORA-01400: --cannot insert NULL into () 不能将空值插入
ORA-00936: --缺少表达式
ORA-00933: --SQL 命令未正确结束
ORA-01722: --无效数字:(一般可能是企图将字符串类型的值填入数字型而造成)
ORA-06530: ACCESS_INTO_NULL --企图将值写入未初化对象的属性
Your program attempts to assign values to the attributes of an uninitialized (atomically null) object.
ORA-06592: CASE_NOT_FOUND --case语句格式有误,没有分支语句
None of the choices in the WHEN clauses of a CASE statement is selected, and there is no ELSE clause.
ORA-06531: COLLECTION_IS_NULL --企图将集合填入未初始化的嵌套表中
Your program attempts to apply collection methods other than EXISTS to an uninitialized (atomically null)
nested table or varray, or the program attempts to assign values to the elements of an uninitialized nested
table or varray.
ORA-06511: CURSOR_ALREADY_OPEN --企图打开已经打开的指针.指针已经打开,要再次打开必须先关闭.
Your program attempts to open an already open cursor. A cursor must be closed before it can be reopened. A
cursor FOR loop automatically opens the cursor to which it refers. So, your program cannot open that cursor
inside the loop.
ORA-00001: DUP_VAL_ON_INDEX --数据库字段存储重复,主键唯一值冲突
Your program attempts to store duplicate values in a database column that is constrained by a unique index.
ORA-01001: INVALID_CURSOR --无效指针
Your program attempts an illegal cursor operation such as closing an unopened cursor.
非法指针操作,例如关闭未打开的指针
ORA-01722: INVALID_NUMBER --无效数字
In a SQL statement, the conversion of a character string into a number fails because the string does not
represent a valid number. (In procedural statements, VALUE_ERROR is raised.) This exception is also raised
when the LIMIT-clause **********(星号代表:"**********") in a bulk FETCH statement does not evaluate to a positive number.
在sql语句中,字符数字类型转换错误,无法将字符串转化成有效数字.此错误也可能因为在limit从句表达式中fetch语句无法对应指定数字
ORA-01017: LOGIN_DENIED --拒绝访问
Your program attempts to log on to Oracle with an invalid username and/or password.
企图用无效的用户名或密码登录oracle
ORA-01403: NO_DATA_FOUND --无数据发现
A SELECT INTO statement returns no rows, or your program references a deleted element in a nested table or
an uninitialized element in an index-by table. SQL aggregate functions such as AVG and SUM always return a
value or a null. So, a SELECT INTO statement that calls an aggregate function never raises NO_DATA_FOUND.
The FETCH statement is expected to return no rows eventually, so when that happens, no exception is raised.
ORA-01012: NOT_LOGGED_ON -- 未登录
Your program issues a database call without being connected to Oracle.
程序发送数据库命令,但未与oracle建立连接
ORA-06501: PROGRAM_ERROR --程序错误
PL/SQL has an internal problem.
pl/sql系统问题
ORA-06504: ROWTYPE_MISMATCH --行类型不匹配
The host cursor variable and PL/SQL cursor variable involved in an assignment have incompatible return types.
For example, when an open host cursor variable is passed to a stored subprogram, the return types of the
actual and formal parameters must be compatible.
ORA-30625: SELF_IS_NULL
Your program attempts to call a MEMBER method on a null instance. That is, the built-in parameter SELF
(which is always the first parameter passed to a MEMBER method) is null.
ORA-06500: STORAGE_ERROR --存储错误
PL/SQL runs out of memory or memory has been corrupted.
PL/SQL运行内存溢出或内存冲突
ORA-06533: SUB******_BEYOND_COUNT (*代表"******") --子句超出数量
Your program references a nested table or varray element using an index number larger than the number of
elements in the collection.
ORA-06532: SUB******_OUTSIDE_LIMIT (*代表"******") --子句非法数量
Your program references a nested table or varray element using an index number (-1 for example) that is
outside the legal range.
ORA-01410: SYS_INVALID_ROWID --无效的字段名
The conversion of a character string into a universal rowid fails because the character string does not
represent a valid rowid.
ORA-00051: TIMEOUT_ON_RESOURCE --资源等待超时
A time-out occurs while Oracle is waiting for a resource.
ORA-01422: TOO_MANY_ROWS --返回超过一行
A SELECT INTO statement returns more than one row.
ORA-06502: VALUE_ERROR --值错误
An arithmetic, conversion, truncation, or size-constraint error occurs. For example, when your program selects
a column value into a character variable, if the value is longer than the declared length of the variable,
PL/SQL aborts the assignment and raises VALUE_ERROR. In procedural statements, VALUE_ERROR is raised if the conversion of a character string into a number fails. (In SQL statements, INVALID_NUMBER is raised.)
ORA-01476: ZERO_DIVIDE --除0错误
Your program attempts to divide a number by zero.
ps.by scholar
在我的水平上发表些浅显的看法吧.
由于上面文字是转载来的.不确定是否存在着断章的问题.据我的理解.应该是java中连接Oracle数据库所产生的SQLException.平时我所使用的多为SqlServer数据库.而且查询分析器会有错误的中文提示.况且平时程序写好了也是通过后台服务来查错.比如Tomcat.weblogic等.如果操作Oracle数据库也是通过PL/SQL.如果sql有错.也会提示中文信息.所以相对来说.以上的错误归纳暂时用不到.可能不通过中间工具直接操作Oracle会用到吧.所以暂时没有对以上的内容加以验证.也就无从修正.
像sql里的错误一样...我的错误总是可预期但不可避免的发生着.数据库可以备份.事务可以回滚.错误可以尽可能的弥补回来.但.生活呢?.不能.生活没有备份.错事不可以回滚...错了.就是错了.工作的很多时间在修改程序里的bug.生活的很多时间在反省着自己的错误.查询前人的经验教训.却无法不去犯相同错.!