How can I get position of an error in the query?
I need to get position in a query string which causes an error, like sqlplus
does it:
S
The SQLException
has additional fields that hold the SQL error number (as in ORA-12899
) and a message something like what you see as value too large for column "schmnm"."tbl"."data" (actual: 5, maximum: 3)
You have to parse the string if you want to truely pinpoint the error in the SQL statement.
See: http://docs.oracle.com/javase/6/docs/api/java/sql/SQLException.html
Read about the errorCode
and SQLState
properties within the exception.