8 messages in com.mysql.lists.javaRe: sql warnings and JDBC| From | Sent On | Attachments |
|---|---|---|
| Jan Kuehl | 20 Mar 2006 05:44 | |
| Rhino | 20 Mar 2006 06:33 | |
| Jan Kuehl | 20 Mar 2006 07:02 | |
| Ronald Boettcher | 20 Mar 2006 07:34 | |
| Gustitus, Paul | 20 Mar 2006 07:42 | |
| Jan Kuehl | 20 Mar 2006 07:46 | |
| Ronald Boettcher | 20 Mar 2006 08:22 | |
| SOTL | 21 Mar 2006 05:50 |
| Subject: | Re: sql warnings and JDBC![]() |
|---|---|
| From: | Rhino (rhi...@sympatico.ca) |
| Date: | 03/20/2006 06:33:03 AM |
| List: | com.mysql.lists.java |
----- Original Message ----- From: "Jan Kuehl" <jan....@software-tomography.com> To: <ja...@lists.mysql.com> Sent: Monday, March 20, 2006 8:45 AM Subject: sql warnings and JDBC
Hi
I have changed my environment from an old 3.0.11 JDBC driver to the new 3.1.12. The old driver suppress the warnings from the mysql server which the new reports as SQLExceptions. How can I check if the SQLExceptions is a warning or an error?
Example: CREATE TABLE d(i INT AUTO_INCREMENT NOT NULL); INSERT INTO d VALUES('0'); -> ok INSERT INTO d VALUES(''); -> ok with warning = SQLException
I don't think I understand your question/problem but here's some information that _might_ be useful.
A simple way to determine what went wrong with an SQL statement is to put each SQL statement in a try block like this:
try { <your SQL statement> } catch (SQLException sql_excp) { System.err.println("SQLState: " + sql_excp.getSQLState()); System.err.println("SQLCode: " + sql_excp.getErrorCode()); System.err.println("Message: " + sql_excp.getMessage()); }
If you clarify what your concern is, perhaps someone on this list can give you a more useful answer.
-- Rhino
-- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.2.5/284 - Release Date: 17/03/2006




