a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 419|回复: 1

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

[复制链接]
发表于 2012-8-4 14:06:19 | 显示全部楼层 |阅读模式
最近使用Oracle时老是遇到java.sql.SQLException错误,害得我在网上查得累死累活的,所以一口气查了一下几个常见的,在此列了列.英文是来自官方的,用中文简单翻译了一下,有一些实在不知道怎么翻译,也没有尝试重现,所以将英文原文一并列出,供有需要的人查阅!+ {. t5 I; I# I% q, |
ORA-00904:    invalid column name 无效列名; ]2 ?" H, I$ U/ ^+ C4 k
ORA-00942:  table or view does not exist 表或者视图不存在+ q8 q2 u, x; k8 ^
ORA-01400:  cannot insert NULL into () 不能将空值插入; n4 c- ^( [& L( g
ORA-00936: 缺少表达式
9 X2 K" M+ B& }1 \7 \* nORA-00933: SQL 命令未正确结束
% S% M" `5 k) F, r. y! K, vORA-01722: 无效数字:(一般可能是企图将字符串类型的值填入数字型而造成)8 _2 R. g" c  u( w. j5 J. w. ]3 K
ORA-06530: ACCESS_INTO_NULL 
3 N  M& D& G: R2 P- [Your program attempts to assign values to the attributes of an uninitialized (atomically null) object.+ `" O# [' X. h7 k# W
企图将值写入未初化对象的属性* L! j- Y" U: x9 `- Y3 i
ORA-06592: CASE_NOT_FOUND2 t( ^, }4 _4 E  l: L
None of the choices in the WHEN clauses of a CASE statement is selected, and there is no ELSE clause.3 t* q1 s9 j/ z; ~
case语句格式有误,没有分支语句
( j5 b  p3 S- @, [1 K6 i2 b/ i! mORA-06531: COLLECTION_IS_NULL
4 k) K; Z2 D8 w& ]Your program attempts to apply collection methods other than EXISTS to an uninitialized (atomically null)
6 T& j3 U* x) o: u4 a3 ^nested table or varray, or the program attempts to assign values to the elements of an uninitialized nested & \+ t: M3 p" X
table or varray.( k& i$ ~6 t2 \- U9 d) f" P
企图将集合填入未初始化的嵌套表中
" |6 c6 }: q5 p5 q/ Y2 RORA-06511: CURSOR_ALREADY_OPEN+ |2 }8 w) W* y/ H
Your program attempts to open an already open cursor. A cursor must be closed before it can be reopened. A' ?! }  V- C9 P/ D
cursor FOR loop automatically opens the cursor to which it refers. So, your program cannot open that cursor' c! K0 M+ a; T" |1 E# q
inside the loop.) r! u) u, T2 d! n0 _& @
企图打开已经打开的指针.指针已经打开,要再次打开必须先关闭.: C: L. f/ _: b& w1 G$ Z: S7 D( O
ORA-00001: DUP_VAL_ON_INDEX
7 |5 V- [# Z! n2 ?/ JYour program attempts to store duplicate values in a database column that is constrained by a unique index.% k2 s) \2 i+ I% W, I0 V8 m
数据库字段存储重复,主键唯一值冲突( p$ `( w9 h6 U0 c% r0 ^- c
ORA-01001: INVALID_CURSOR 无效指针" g) A$ U5 o0 N% W1 M
Your program attempts an illegal cursor operation such as closing an unopened cursor.
- m% a, P, ^. O- o4 e非法指针操作,例如关闭未打开的指针
- u8 m6 t9 R9 bORA-01722: INVALID_NUMBER 无效数字, _$ s8 i+ B& G
In a SQL statement, the conversion of a character string into a number fails because the string does not
8 R& }* F$ x, q9 ^- L- y% H3 brepresent a valid number. (In procedural statements, VALUE_ERROR is raised.) This exception is also raised
6 z, {/ i; _' N' n9 U5 ywhen the LIMIT-clause expression in a bulk FETCH statement does not evaluate to a positive number.
; B. M! Q0 B' |  }3 w& U9 a; h在sql语句中,字符数字类型转换错误,无法将字符串转化成有效数字.此错误也可能因为在limit从句表达式中fetch语句无法对应指定数字- j/ G4 k7 r" G5 i8 _9 I
ORA-01017: LOGIN_DENIED 拒绝访问
0 j, G# R1 d- v( JYour program attempts to log on to Oracle with an invalid username and/or password.- l& t8 O* S  M9 ]: N
企图用无效的用户名或密码登录oracle% _# b) G  h, e7 C: a: Y
ORA-01403: NO_DATA_FOUND 无数据发现/ Z7 c1 s% \. E6 t7 D3 E2 c
A SELECT INTO statement returns no rows, or your program references a deleted element in a nested table or
  u6 p2 q/ G% P% o5 n! T' T, B" dan uninitialized element in an index-by table. SQL aggregate functions such as AVG and SUM always return a
( D! w0 r0 }' C+ ]9 J. `value or a null. So, a SELECT INTO statement that calls an aggregate function never raises NO_DATA_FOUND. , o' \. M- K* z
The FETCH statement is expected to return no rows eventually, so when that happens, no exception is raised., S0 T1 y  X+ a

  S; T8 g* D7 ZORA-01012: NOT_LOGGED_ON   未登录" d5 w* W& u6 M, ~2 _) e+ U; _
Your program issues a database call without being connected to Oracle.
% B$ H& N$ Y2 r0 w6 r9 P; S  `程序发送数据库命令,但未与oracle建立连接0 e! H" a9 |, I) n2 G& f  n

! p; \& y6 g2 UORA-06501: PROGRAM_ERROR 程序错误
. _& G8 o; \1 {4 hPL/SQL has an internal problem., R/ ~" g. F/ q; D% P4 `
pl/sql系统问题
, y  [4 Y( z9 _' Z; x5 C% @# E8 w+ W( P6 h
ORA-06504: ROWTYPE_MISMATCH 行类型不匹配' t3 K& e$ u* {  O; F% o
The host cursor variable and PL/SQL cursor variable involved in an assignment have incompatible return types.
% @) a! }: K4 S0 sFor example, when an open host cursor variable is passed to a stored subprogram, the return types of the 7 Z- c+ A1 P" U- Z/ d% \: [* a& k
actual and formal parameters must be compatible. : ^! t' X* ~  I; N- }- N( @

8 u% E. y4 E, f' P& S) E( lORA-30625: SELF_IS_NULL   L$ _: n6 p$ v5 ?5 ~5 {9 a' r
Your program attempts to call a MEMBER method on a null instance. That is, the built-in parameter SELF
9 j& Y  i* D. T+ C5 v(which is always the first parameter passed to a MEMBER method) is null.: a  P4 z9 F( M' l) A" Z8 a

# k  B9 s& F5 n; FORA-06500: STORAGE_ERROR 存储错误
3 i1 @. D/ l7 S9 }" k& oPL/SQL runs out of memory or memory has been corrupted.& W2 ~3 L7 ^% d; Z5 f
PL/SQL运行内存溢出或内存冲突! n$ h" k8 @6 e
      - T& ?7 D+ B( U6 l
ORA-06533: SUBSCRIPT_BEYOND_COUNT   子句超出数量
8 _( K& h. @" y6 y/ y: |Your program references a nested table or varray element using an index number larger than the number of
: U2 Y9 l' ?3 ^" |' H3 gelements in the collection.0 R$ C  |! m* R, a3 f1 ?1 D

3 r7 d5 \% O2 p1 E1 t: w' JORA-06532: SUBSCRIPT_OUTSIDE_LIMIT   子句非法数量
) t7 {7 u# y  {Your program references a nested table or varray element using an index number (-1 for example) that is " I; p& r/ r7 b
outside the legal range.5 Q+ l& ~, B4 _/ h
1 a1 g, V3 f: u
ORA-01410: SYS_INVALID_ROWID   无效的字段名* G* R. ?9 D1 N6 O- c' P7 f
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. * t3 ^/ t3 [: f! [- y
; Q+ {7 I8 S6 d* q6 W' `* j
ORA-00051: TIMEOUT_ON_RESOURCE    资源等待超时
& U( q! v" Z: F+ r' e, G( GA time-out occurs while Oracle is waiting for a resource.
: n2 c2 u1 }: T8 d, L; v5 r+ }% ?1 d) |- }# X8 Z- V
ORA-01422: TOO_MANY_ROWS    返回超过一行  V9 ]1 w6 x1 j7 A0 u1 A
A SELECT INTO statement returns more than one row.0 V% y! G5 o3 `
/ b! W, K! j+ N/ C5 K, c, a
ORA-06502: VALUE_ERROR   值错误
, L2 u- u/ e8 R! i/ d7 v0 x# U0 gAn arithmetic, conversion, truncation, or size-constraint error occurs. For example, when your program selects! ~2 J7 A" k8 j
a column value into a character variable, if the value is longer than the declared length of the variable,
8 I0 A; Q/ W% RPL/SQL aborts the assignment and raises VALUE_ERROR. In procedural statements, VALUE_ERROR is raised if the
  V4 I$ @: P+ l9 econversion of a character string into a number fails. (In SQL statements, INVALID_NUMBER is raised.)
/ C( U/ ^4 b  M
! m4 |) ^0 a$ e: aORA-01476: ZERO_DIVIDE 除0错误
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-20 12:01 , Processed in 0.332075 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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