Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How to Retrieve SQLWarning
How to Retrieve SQLWarning?
✍: FYICENTER.com
SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the execution of an application, as exceptions do. They simply alert the user that something did not happen as planned. A warning can be reported on a Connection object, a Statement object (including PreparedStatement and CallableStatement objects), or a ResultSet object. Each of these classes has a getWarnings method, which you must invoke in order to see the first warning reported on the calling object
SQLWarning warning = stmt.getWarnings(); if (warning != null) { while (warning != null) { System.out.print("Message: "); System.out.println(warning.getMessage()); System.out.print("SQLState: "); System.out.println(warning.getSQLState()); System.out.print("Vendor error code: "); System.out.println(warning.getErrorCode()); warning = warning.getNextWarning(); } }
2007-04-03, 4989👍, 0💬
Popular Posts:
What is synchronization and why is it important? With respect to multithreading, synchronization is ...
.NET INTERVIEW QUESTIONS - How to prevent my .NET DLL to be decompiled? By design .NET embeds rich M...
How can JavaScript make a Web site easier to use? That is, are there certain JavaScript techniques t...
. How can a servlet refresh automatically if some new data has entered the database? You can use a c...
How was XML handled during COM times? During COM it was done by using MSXML 4.0. So old languages li...