Results 1 to 1 of 1
Thread: Handling SQL Errors and Warnings
-
Handling SQL Errors and Warnings
You may handle SQL errors and warnings in the following way:
Java Code:dbConn = DriverManager.getConnection ("jdbc:odbc:YourDatabaseName","username","password"); SQLWarning w = dbConn.getWarnings(); // If a SQLWarning object was returned by the // Connection object, the warning messages are displayed. // You may have multiple warnings chained together if (w != null) { System.out.println ("\n *** SQL Warning ***\n"); while (w != null) { System.out.println ("Message: " + w.getMessage ()); System.out.println ("SQLState: " + w.getSQLState ()); System.out.println ("VendorCode: " + w.getErrorCode ()); System.out.println (""); w = w.getNextWarning (); } }
Similar Threads
-
help with these errors
By oceansdepth in forum New To JavaReplies: 3Last Post: 04-16-2008, 04:55 PM -
Errors I don't understand
By MattyB in forum New To JavaReplies: 4Last Post: 04-01-2008, 11:55 PM -
Getting warnings reported by Connection object
By Java Tip in forum Java TipReplies: 0Last Post: 01-20-2008, 08:57 AM -
I have 3 errors after compiling
By coco in forum JDBCReplies: 2Last Post: 10-18-2007, 09:32 AM -
Errors in constructor
By ai_2007 in forum Advanced JavaReplies: 0Last Post: 07-01-2007, 05:35 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks