a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 496|回复: 1

[考试辅导] Oracle关于java.sql.SQLException常见错误集锦

[复制链接]
发表于 2012-8-4 14:06:19 | 显示全部楼层 |阅读模式
最近使用Oracle时老是遇到java.sql.SQLException错误,害得我在网上查得累死累活的,所以一口气查了一下几个常见的,在此列了列.英文是来自官方的,用中文简单翻译了一下,有一些实在不知道怎么翻译,也没有尝试重现,所以将英文原文一并列出,供有需要的人查阅!1 V: S6 p% _) {. z/ R+ n5 X! Y
ORA-00904:    invalid column name 无效列名! E0 F4 ]; \" h( t+ {2 Y3 K" j
ORA-00942:  table or view does not exist 表或者视图不存在7 V- \, x9 z: W% Y+ |( G  C" ~$ ]! K$ C
ORA-01400:  cannot insert NULL into () 不能将空值插入
9 V; B$ r2 I% ]& {3 H" sORA-00936: 缺少表达式
" H5 I. S6 b0 @# n. {ORA-00933: SQL 命令未正确结束
5 G( h- Q- O9 P/ P% D% j- @ORA-01722: 无效数字:(一般可能是企图将字符串类型的值填入数字型而造成)  t! S5 O1 [8 h% V+ m  |
ORA-06530: ACCESS_INTO_NULL 
: u# a- U# s1 E- A- d3 \Your program attempts to assign values to the attributes of an uninitialized (atomically null) object.
3 V# X, R0 Y' I1 o4 P7 R# X企图将值写入未初化对象的属性
4 a8 `. b# x1 X' u7 OORA-06592: CASE_NOT_FOUND
+ `2 d9 c! {7 e+ D- ~" ]None of the choices in the WHEN clauses of a CASE statement is selected, and there is no ELSE clause.
- F, k  k; E8 `3 `# J7 t% Zcase语句格式有误,没有分支语句
9 q2 b/ o& n7 v2 B: P$ l$ VORA-06531: COLLECTION_IS_NULL  U. h* {' t6 O; x# f: K0 S& l4 Q
Your program attempts to apply collection methods other than EXISTS to an uninitialized (atomically null)
1 ~' ]" Z$ }, D: i4 Znested table or varray, or the program attempts to assign values to the elements of an uninitialized nested
9 A# G0 t: A4 o7 k& e; ?4 \6 Etable or varray.8 _8 |" R; z3 f7 `3 O
企图将集合填入未初始化的嵌套表中
2 V; z% B* f9 ^2 CORA-06511: CURSOR_ALREADY_OPEN% a. O3 n/ V  x  v7 T" O
Your program attempts to open an already open cursor. A cursor must be closed before it can be reopened. A
; d) X7 k9 y  f! {6 U3 ?cursor FOR loop automatically opens the cursor to which it refers. So, your program cannot open that cursor
0 N* k$ ~8 G' x; f2 k) zinside the loop.
3 y8 t3 j' |3 R; P4 ^企图打开已经打开的指针.指针已经打开,要再次打开必须先关闭.5 \: |7 L5 ~3 w
ORA-00001: DUP_VAL_ON_INDEX
. X. f" V" e% A  r# i' oYour program attempts to store duplicate values in a database column that is constrained by a unique index.
1 A9 Y$ S) z* }# U6 `5 i* `! {0 H数据库字段存储重复,主键唯一值冲突5 K$ L# x+ Q. C. a* y$ h
ORA-01001: INVALID_CURSOR 无效指针" H9 I, k& `) D- E
Your program attempts an illegal cursor operation such as closing an unopened cursor.
* r! I  C4 B; a5 p8 X/ L8 q# Y非法指针操作,例如关闭未打开的指针8 i! Z  x5 `6 N9 z( @) ~
ORA-01722: INVALID_NUMBER 无效数字0 o+ J. y9 v6 W( i) Y. q. ?
In a SQL statement, the conversion of a character string into a number fails because the string does not
6 y8 y" h6 q$ ^% q$ y2 arepresent a valid number. (In procedural statements, VALUE_ERROR is raised.) This exception is also raised # e! Q6 t) T7 R: y- K6 J, K" a
when the LIMIT-clause expression in a bulk FETCH statement does not evaluate to a positive number.7 v6 y1 f. P7 h& H) ?8 \7 k  I; g& _
在sql语句中,字符数字类型转换错误,无法将字符串转化成有效数字.此错误也可能因为在limit从句表达式中fetch语句无法对应指定数字
1 o) ?0 ?3 R- _5 _/ Y: MORA-01017: LOGIN_DENIED 拒绝访问9 b3 g1 g* r+ }# P+ {
Your program attempts to log on to Oracle with an invalid username and/or password.2 Q, \( ]$ u2 P* @% B
企图用无效的用户名或密码登录oracle
( x; _2 X% L% ^3 a# [+ I7 P8 DORA-01403: NO_DATA_FOUND 无数据发现
9 Q+ c6 V/ G) r  p) c; p5 kA SELECT INTO statement returns no rows, or your program references a deleted element in a nested table or   T+ f1 D  o! I" ]* o5 O5 @; a
an uninitialized element in an index-by table. SQL aggregate functions such as AVG and SUM always return a 3 v1 X) `5 B1 W6 F, R
value or a null. So, a SELECT INTO statement that calls an aggregate function never raises NO_DATA_FOUND.
/ W- _6 J9 j$ q" k3 hThe FETCH statement is expected to return no rows eventually, so when that happens, no exception is raised.
. q' j6 o: j3 h, n$ E/ m8 H9 t2 X$ }8 L3 c7 b  ?5 |; Q" v
ORA-01012: NOT_LOGGED_ON   未登录
; f( Q9 n1 {  ^- i. ~6 ~Your program issues a database call without being connected to Oracle.+ q) o' W, `+ a- {: \& f5 w, u0 L+ u
程序发送数据库命令,但未与oracle建立连接
! N) }6 |* ^* E# P  N8 z2 J- E; l8 H& j8 h
ORA-06501: PROGRAM_ERROR 程序错误; g$ e& C/ o) ]
PL/SQL has an internal problem.6 A4 G' }# a; Z: P$ ?+ ?( d$ A3 o
pl/sql系统问题
3 Y, q  @" J9 t; q3 l7 U. T* p8 i+ w* ?. M* b
ORA-06504: ROWTYPE_MISMATCH 行类型不匹配# \- s6 o  S* G! \
The host cursor variable and PL/SQL cursor variable involved in an assignment have incompatible return types. 7 Y  P: E8 T5 t7 Q, q% `5 J
For example, when an open host cursor variable is passed to a stored subprogram, the return types of the
' H! J2 Q; ~+ h6 s4 H% g3 {0 hactual and formal parameters must be compatible. . J/ A9 d4 K* u$ _9 @  l7 b; I: U
. f1 f# [( K9 P9 N' R
ORA-30625: SELF_IS_NULL 3 I  j8 ]5 O* U- t; n' t
Your program attempts to call a MEMBER method on a null instance. That is, the built-in parameter SELF 5 z1 B7 [: u- W8 ^( F( W
(which is always the first parameter passed to a MEMBER method) is null.' C; U6 `( Q% h' b2 ^) E9 o( ^! {
% X6 P( J( e* g0 h& M
ORA-06500: STORAGE_ERROR 存储错误& v0 `, M1 u. d" w
PL/SQL runs out of memory or memory has been corrupted.
- N/ ?# a) F3 Z" Z1 Q" cPL/SQL运行内存溢出或内存冲突
0 B2 F4 I. a# x      
4 T1 |* e) S+ g7 ~ORA-06533: SUBSCRIPT_BEYOND_COUNT   子句超出数量6 k  F9 F( W3 K" T9 Z4 w4 h+ g
Your program references a nested table or varray element using an index number larger than the number of ) m0 J* n0 S/ w1 ^2 H' x) l0 C
elements in the collection.
# U& _* I( S" v  {3 w6 L. d) L/ }$ c! w. }: y
ORA-06532: SUBSCRIPT_OUTSIDE_LIMIT   子句非法数量
) [4 o! k7 l3 N* x* eYour program references a nested table or varray element using an index number (-1 for example) that is % d: z- Z9 T7 S2 c" n% Q
outside the legal range.
1 X7 k) D- o! P- h0 M0 O) W, P5 o) K" |, V
ORA-01410: SYS_INVALID_ROWID   无效的字段名8 o% _6 T  s# T& n5 v' W# {
The conversion of a character string into a universal rowid fails because the character string does not
回复

使用道具 举报

 楼主| 发表于 2012-8-4 14:06:20 | 显示全部楼层

Oracle关于java.sql.SQLException常见错误集锦

represent a valid rowid.
1 v# G# A% N7 q6 v7 c8 e
- E6 P2 `9 l; }ORA-00051: TIMEOUT_ON_RESOURCE    资源等待超时) T) j1 Z  y( G! z* |1 V  @" e5 q
A time-out occurs while Oracle is waiting for a resource. ! W$ \9 J% ~' V4 Y- u7 d$ B
! Y# B% M1 i( j4 ?/ ^& z6 i5 C" \
ORA-01422: TOO_MANY_ROWS    返回超过一行' q- i1 w4 m. J% I; T( v( D
A SELECT INTO statement returns more than one row.
8 k/ Q- f! m& {% }, E( i: V/ @; @0 |' l* i  b0 \7 m
ORA-06502: VALUE_ERROR   值错误1 E- T; V/ A6 r
An arithmetic, conversion, truncation, or size-constraint error occurs. For example, when your program selects
/ N+ c2 \1 J) I3 Va column value into a character variable, if the value is longer than the declared length of the variable, 5 b! P2 g) D6 V% A& y( O9 K
PL/SQL aborts the assignment and raises VALUE_ERROR. In procedural statements, VALUE_ERROR is raised if the
5 ?% E$ v- w" o0 Y' o5 M& fconversion of a character string into a number fails. (In SQL statements, INVALID_NUMBER is raised.)
. D2 |9 q7 `" b" ^. ?% L: r7 p( J, |& e9 a7 v9 l% b% d
ORA-01476: ZERO_DIVIDE 除0错误
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-9-23 02:05 , Processed in 0.243058 second(s), 24 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表