Some of the most common errors in JDBC access to Oracle databases. The example in the sample code and/or comment column shows the type of SQL statement that caused the error or additional comments about the specific error that is displayed on the row in the table.
Table 1
Error Mark |
Oracle Error |
SQLState |
Sample code and/or comments |
Based on statement: SELECT ename SQL related error from EMP variant |
"Uniqueness Constraint" |
1 |
2300 |
For example, primary key violation |
"Resource busy and specify nowait to get Resources" |
54 |
61000 |
Only appears when NOWAIT is specified |
"Invalid SQL statement" |
900 |
42000 |
Ename from EMP |
"Invalid table name" |
903 |
42000 |
SELECT ename from |
"Invalid identifier" |
904 |
42000 |
SELECT EMPname from emp |
"Invalid character" |
911 |
42000 |
SELECT ename from EMP; |
"Missing Columns" |
917 |
42000 |
Omitting commas when you need commas to separate columns in an INSERT statement can be a reason. |
"The FROM keyword was not found at the desired location" |
923 |
42000 |
SELECT ename EMP |
"Missing expression" |
936 |
42000 |
SELECT from EMP |
"Table or view does not exist" |
942 |
42000 |
SELECT ename from Empp |
"Cannot insert null value" |
1400 |
23000 |
An attempt was made to insert a null value into a column that contains a not NULL constraint |
"Value is greater than specified precision for this column" |
1438 |
22003 |
An attempt was made to insert a number of digits with more precision than the column allowed |
"Invalid number" |
1722 |
42000 |
Trying to perform a numeric function on a character |
"Integrity constraint Failed" |
2291 |
23000 |
Attempted to insert a row containing a foreign key that does not match an existing primary key |
"Value too large," |
12899 |
72000 |
Attempted to insert a value that exceeds the allowable range of the column (for example, too many characters) |
"Io Exception" |
17002 |
No |
Error from Oracle JDBC driver does not correspond to SQLState (NULL) |
"Invalid column index" |
17003 |
No |
|
"Invalid column name" |
17006 |
No |
|
"Value Overflow" |
17026 |
No |
|