By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,586 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,586 IT Pros & Developers. It's quick & easy.

Get human-readable error meesages ala db2 ? sql00911

P: n/a
aj
DB2 WSE 8.1 FP5
Red Hat Linux AS 2.1

I am working on a Java-Swing based interface for a DB2 database,
and want to display more human-readable error meesages to the
end user when/if a database exception occurs. I am using the
type 4 Universal JDBC driver.

If I have an SQLCODE & SQLSTATE, where do I look to get a human
readable/comprehensive error message to show the end-user? I
don't want the cryptic one that only DBA's love...

Another way to put this: I want to access programatically with
SQL or whatever the same source of info that this does:
-------------------------
db2 => ? sql00911

SQL0911N The current transaction has been rolled back because of
a deadlock or timeout. Reason code "<reason-code>".

Explanation:

The current unit of work was involved in an unresolved contention
for use of an object and had to be rolled back.

The reason codes are as follows:
2 transaction rolled back due to deadlock.

....and so on and so forth...........

Any ideas?

aj

Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In article <11*************@news.supernews.com>, aj
(ro****@mcdonalds.com) says...
DB2 WSE 8.1 FP5
Red Hat Linux AS 2.1

I am working on a Java-Swing based interface for a DB2 database,
and want to display more human-readable error meesages to the
end user when/if a database exception occurs. I am using the
type 4 Universal JDBC driver.

If I have an SQLCODE & SQLSTATE, where do I look to get a human
readable/comprehensive error message to show the end-user? I
don't want the cryptic one that only DBA's love...

Another way to put this: I want to access programatically with
SQL or whatever the same source of info that this does:
-------------------------
db2 => ? sql00911

SQL0911N The current transaction has been rolled back because of
a deadlock or timeout. Reason code "<reason-code>".

Explanation:

The current unit of work was involved in an unresolved contention
for use of an object and had to be rolled back.

The reason codes are as follows:
2 transaction rolled back due to deadlock.

...and so on and so forth...........

Any ideas?

aj


Did you search the docs?

Check http://tinyurl.com/ajr39
Nov 12 '05 #2

P: n/a
aj wrote:
DB2 WSE 8.1 FP5
Red Hat Linux AS 2.1

I am working on a Java-Swing based interface for a DB2 database,
and want to display more human-readable error meesages to the
end user when/if a database exception occurs. I am using the
type 4 Universal JDBC driver.

If I have an SQLCODE & SQLSTATE, where do I look to get a human
readable/comprehensive error message to show the end-user? I
don't want the cryptic one that only DBA's love...


I don't think you can do that using pure java, but if you care to write JNI
wrapper for sqlaintp() or sqlogstt() API calls - you would be all set...

Jan M. Nelken
Nov 12 '05 #3

P: n/a
aj wrote:
DB2 WSE 8.1 FP5
Red Hat Linux AS 2.1

I am working on a Java-Swing based interface for a DB2 database,
and want to display more human-readable error meesages to the
end user when/if a database exception occurs. I am using the
type 4 Universal JDBC driver.

If I have an SQLCODE & SQLSTATE, where do I look to get a human
readable/comprehensive error message to show the end-user? I
don't want the cryptic one that only DBA's love...


If you care to write JNI wrapper for sqlaintp() or sqlogstt() API calls - you
would be all set as well - but Gert solution is cleaner...

Jan M. Nelken
Nov 12 '05 #4

P: n/a
aj wrote:
DB2 WSE 8.1 FP5
Red Hat Linux AS 2.1

I am working on a Java-Swing based interface for a DB2 database,
and want to display more human-readable error meesages to the
end user when/if a database exception occurs. I am using the
type 4 Universal JDBC driver.

If I have an SQLCODE & SQLSTATE, where do I look to get a human
readable/comprehensive error message to show the end-user? I
don't want the cryptic one that only DBA's love...

Another way to put this: I want to access programatically with
SQL or whatever the same source of info that this does:
-------------------------
db2 => ? sql00911

SQL0911N The current transaction has been rolled back because of
a deadlock or timeout. Reason code "<reason-code>".

Explanation:

The current unit of work was involved in an unresolved contention
for use of an object and had to be rolled back.

The reason codes are as follows:
2 transaction rolled back due to deadlock.

...and so on and so forth...........

Any ideas?

aj

Take a look at my developer Works article on tracing. It contains a
C-function that composes the error message from the SQLCA.
(www.ibm.com search for: rielau)

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.