3

I have my java program connected to postgresql. I want to retrieve the error codes for sqlexception. I found the error code for postgresql here.

But Java's SQLException contains only methods for error codes returned as int getErrorCode()

But the error codes in the link are not of the type int. Where can I get the int error codes for postgresql?`

1 Answer 1

5

I think that getSQLState() is what you are looking for:

http://docs.oracle.com/javase/6/docs/api/java/sql/SQLException.html#getSQLState()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.