Serializablepublic class OracleDatabaseException extends Exception
try{
myStatement.executeUpdate();
}
catch (SQLException sqlx) {
if(sqlx.getCause() != null &&
sqlx.getCause() instanceof OracleDatabaseException) {
int sqlErrorPosition =
((OracleDatabaseException)sqlx.getCause()).getErrorPosition();
}
}
| Constructor | Description |
|---|---|
OracleDatabaseException(int errorPosition,
int oracleErrorNumber,
String oracleErrorMessage,
String sql,
String originalSql) |
| Modifier and Type | Method | Description |
|---|---|---|
int |
getErrorPosition() |
In case of a parsing error, this method returns the position of the
error in the actual SQL which has failed in the server.
|
int |
getOracleErrorNumber() |
Returns the Oracle error number for this failure.
|
String |
getOriginalSql() |
Returns the original SQL used to create the Statement.
|
String |
getSql() |
Returns the actual SQL which was sent to the server.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTracepublic int getErrorPosition()
getSql(). It may be different from
the original SQL returned by getOriginalSql().public int getOracleErrorNumber()
public String getSql()
public String getOriginalSql()
getSql(). The method
getErrorPosition() returns the position of the
error in the actual SQL sent to the database, not the original
SQL returned by this method.
Copyright © 2008, 2017, Oracle. All rights reserved.