Changeset: 55b4478d0168 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=55b4478d0168 Modified Files: java/ChangeLog.Dec2011 java/src/nl/cwi/monetdb/mcl/io/BufferedMCLReader.java Branch: Dec2011 Log Message:
JDBC: allow server to send SQLSTATE codes diffs (40 lines): diff --git a/java/ChangeLog.Dec2011 b/java/ChangeLog.Dec2011 --- a/java/ChangeLog.Dec2011 +++ b/java/ChangeLog.Dec2011 @@ -3,8 +3,8 @@ * Sun Dec 11 2011 Fabian Groffen <[email protected]> - SQLExceptions thrown now carry a SQLSTATE. Until the server starts - sending correct SQLSTATEs for errors, all server originated errors - are considered generic data exceptions (22000). + sending correct SQLSTATEs for all errors, server originated errors + without SQLSTATE are considered generic data exceptions (22000). * Sat Dec 10 2011 Fabian Groffen <[email protected]> - Fixed a bug where closing ResultSets and PreparedStatements could lead diff --git a/java/src/nl/cwi/monetdb/mcl/io/BufferedMCLReader.java b/java/src/nl/cwi/monetdb/mcl/io/BufferedMCLReader.java --- a/java/src/nl/cwi/monetdb/mcl/io/BufferedMCLReader.java +++ b/java/src/nl/cwi/monetdb/mcl/io/BufferedMCLReader.java @@ -100,9 +100,10 @@ public class BufferedMCLReader extends B * method returns, it sets the linetype to any of the in MCL * recognised line types. * <br /><br /> - * Warning: until the server properly prefixes its error messages - * with SQLSTATE codes, this method prefixes all errors it sees with - * the generic data exception code (22000). + * Warning: until the server properly prefixes all of its error + * messages with SQLSTATE codes, this method prefixes all errors it + * sees without sqlstate with the generic data exception code + * (22000). * * @return A String containing the contents of the line, not * including any line-termination characters, or null if the @@ -112,7 +113,7 @@ public class BufferedMCLReader extends B public String readLine() throws IOException { String r = super.readLine(); setLineType(r); - if (lineType == ERROR) + if (lineType == ERROR && r.matches("^[0-9A-Z]{5}:")) r = "!22000:" + r.substring(1); return(r); } _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
