EasyManuals Logo

IBM DB2 User Manual

IBM DB2
585 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #96 background imageLoading...
Page #96 background image
// individual SQLERRMC tokens
String sqlErrp = sqlca.getSqlErrp(); 5d7
// Get the SQLERRP
int[] sqlErrd = sqlca.getSqlErrd(); 5d8
// Get SQLERRD fields
char[] sqlWarn = sqlca.getSqlWarn(); 5d9
// Get SQLWARN fields
String sqlState = sqlca.getSqlState(); 5d10
// Get SQLSTATE
String errMessage = sqlca.getMessage(); 5d11
// Get error message
System.err.println ("Server error message: " + errMessage);
System.err.println ("--------------- SQLCA ---------------");
System.err.println ("Error code: " + sqlCode);
System.err.println ("SQLERRMC: " + sqlErrmc);
If (sqlErrmcTokens != null) {
for (int i=0; i< sqlErrmcTokens.length; i++) {
System.err.println (" token"+i+":"+sqlErrmcTokens[i]);
}
}
System.err.println ( "SQLERRP: " + sqlErrp );
System.err.println (
"SQLERRD(1): " + sqlErrd[0] + "\n" +
"SQLERRD(2): " + sqlErrd[1] + "\n" +
"SQLERRD(3): " + sqlErrd[2] + "\n" +
"SQLERRD(4): " + sqlErrd[3] + "\n" +
"SQLERRD(5): " + sqlErrd[4] + "\n" +
"SQLERRD(6): " + sqlErrd[5] );
System.err.println (
"SQLWARN1: " + sqlWarn[0] + "\n" +
"SQLWARN2: " + sqlWarn[1] + "\n" +
"SQLWARN3: " + sqlWarn[2] + "\n" +
"SQLWARN4: " + sqlWarn[3] + "\n" +
"SQLWARN5: " + sqlWarn[4] + "\n" +
"SQLWARN6: " + sqlWarn[5] + "\n" +
"SQLWARN7: " + sqlWarn[6] + "\n" +
"SQLWARN8: " + sqlWarn[7] + "\n" +
"SQLWARN9: " + sqlWarn[8] + "\n" +
"SQLWARNA: " + sqlWarn[9] );
System.err.println ("SQLSTATE: " + sqlState);
// portion of SQLException
}
sqle=sqle.getNextException(); // Retrieve next SQLException 5e
}
}
Related tasks
“Handling an SQLWarning under the IBM Data Server Driver for JDBC and
SQLJ” on page 81
“Handling SQL errors in an SQLJ application” on page 154
“Handling SQL warnings in an SQLJ application” on page 155
Related reference
“Error codes issued by the IBM Data Server Driver for JDBC and SQLJ” on
page 382
“DB2Diagnosable interface” on page 344
“DB2Sqlca class” on page 353
“SQLSTATEs issued by the IBM Data Server Driver for JDBC and SQLJ” on
page 388
80 Application Programming Guide and Reference for Java

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM DB2 and is the answer not in the manual?

IBM DB2 Specifications

General IconGeneral
DeveloperIBM
Initial Release1983
LicenseProprietary
Written inC, C++
CategoryDatabase Management System (RDBMS)
Operating SystemLinux, Windows
Programming LanguagesC, C++
Data ModelsRelational
EditionsCommunity, Standard, Advanced
Key Featureshigh availability, scalability