Changeset: 60063c67f9e7 for monetdb-java URL: https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=60063c67f9e7 Added Files: tests/Bug_Connect_as_voc_getMetaData_Failure_Bug_6388.java tests/Bug_PrepStmtSetObject_CLOB_6349.java tests/Bug_PrepStmtSetString_6382.java Modified Files: .hgtags ChangeLog ChangeLog-Archive SQLSTATEs build.properties pom.xml release.txt src/main/java/nl/cwi/monetdb/client/JdbcClient.java src/main/java/nl/cwi/monetdb/jdbc/MonetBlob.java src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java src/main/java/nl/cwi/monetdb/jdbc/MonetDataSource.java src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java src/main/java/nl/cwi/monetdb/mcl/connection/mapi/MapiConnection.java tests/BugDecimalRound_Bug_3561.java tests/BugExecuteUpdate_Bug_3350.java tests/BugResultSetMetaData_Bug_6183.java tests/Test_Dobjects.java tests/Test_PSmetadata.java tests/build.xml Branch: embedded Log Message:
Merged with default diffs (truncated from 7988 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -1,1 +1,3 @@ 80de05f07508fec938845b4a6e05f600bf0b48c0 v2.24 +c43c293f3d5841517cbe0d858108c4da5fb1ec0c v2.26 +a6a2f4ee2d42d7e192f9d8d37f79ea99178d7f2c v2.25 diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ # ChangeLog file for monetdb-java # This file is updated with Maddlog +* Thu Sep 7 2017 Martin van Dinther <martin.van.dint...@monetdbsolutions.com> +- Implemented PreparedStatement methods setNCharacterStream(int, Reader) + and setNCharacterStream(int, Reader, long). + +* Thu Aug 31 2017 Martin van Dinther <martin.van.dint...@monetdbsolutions.com> +- Corrected PreparedStatement methods setString(int, String) + and setObject(int, Object, ...) in case the target parameter + data type was json or inet or url or uuid. See also + https://www.monetdb.org/bugzilla/show_bug.cgi?id=6382 + +* Thu Aug 24 2017 Martin van Dinther <martin.van.dint...@monetdbsolutions.com> +- Implemented PreparedStatement method setURL(int, URL). +- Implemented PreparedStatement method setNString(int, String). +- The MonetDB JDBC driver code and jdbcclient program are now compiled + without debug info and with optimise flag enabled. The new jar files are + now smaller in size. + +* Thu Aug 17 2017 Martin van Dinther <martin.van.dint...@monetdbsolutions.com> +- Implemented ResultSet method getNCharacterStream(). +- In class MonetClob implemented methods getCharacterStream() + and getCharacterStream(long pos, long length). Method + getCharacterStream() is called by DBeaver to fetch the Clob value. + It used to throw a SQLFeatureNotSupportedException with message: + "Method getCharacterStream() currently not supported". This caused + DBeaver to log the exception and show NULL as the value on screen, + which is incorrect. This has been fixed. + +* Fri Jul 28 2017 Sjoerd Mullender <sjo...@acm.org> +- Compiled and released new jars: monetdb-jdbc-2.26.jar and updated jdbcclient.jar + +* Thu Jul 13 2017 Martin van Dinther <martin.van.dint...@monetdbsolutions.com> +- Corrected implementation of PreparedStatement method + setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) + for the case the targetSqlType is Types.CLOB. + See also: https://www.monetdb.org/bugzilla/show_bug.cgi?id=6349 + diff --git a/ChangeLog-Archive b/ChangeLog-Archive --- a/ChangeLog-Archive +++ b/ChangeLog-Archive @@ -1,6 +1,25 @@ # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY # This file contains past monetdb-java ChangeLog entries +* Fri Jul 28 2017 Sjoerd Mullender <sjo...@acm.org> +- Compiled and released new jars: monetdb-jdbc-2.26.jar and updated jdbcclient.jar + +* Thu Jul 13 2017 Martin van Dinther <martin.van.dint...@monetdbsolutions.com> +- Corrected implementation of PreparedStatement method + setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) + for the case the targetSqlType is Types.CLOB. + See also: https://www.monetdb.org/bugzilla/show_bug.cgi?id=6349 + +* Thu Mar 30 2017 Sjoerd Mullender <sjo...@acm.org> +- Compiled and released new jars: monetdb-jdbc-2.25.jar, monetdb-mcl-1.15.jar + and updated jdbcclient.jar + +* Thu Mar 9 2017 Martin van Dinther <martin.van.dint...@monetdbsolutions.com> +- Corrected ResultSetMetaData methods getColumnLabel(int), getColomnName(int), + getTableName(int) and getSchemaName(int) for names which contain special + characters such as a space, a tab, a comma, a double quote, etc. + See also: https://www.monetdb.org/bugzilla/show_bug.cgi?id=6183 + * Wed Dec 21 2016 Sjoerd Mullender <sjo...@acm.org> - Compiled and released new jars: monetdb-jdbc-2.24.jar, monetdb-mcl-1.14.jar and updated jdbcclient.jar diff --git a/SQLSTATEs b/SQLSTATEs --- a/SQLSTATEs +++ b/SQLSTATEs @@ -1,56 +1,71 @@ -08M01 opening logfile failed +Following SQLStates are MonetDB JDBC driver specific: 01M02 redirect warning -M0M03 illegal arguments (invalid call of internal function) 01M03 illegal arguments (invalid call of internal function) -M0M04 only supported in SQL mode -M1M05 invalid argument (user supplied) -M0M06 savepoint is not MonetSavepoint 01M07 unrecognised clientinfo property 01M08 read-only conection mode not supported 01M09 transaction mode not supported -M0M10 protocol violation/unexpected server response 01M10 unexpected server output 01M11 server-client autocommit state mismatch -M0M12 matching client handle referenced by server not found 01M13 concurrency mode not supported 01M14 scrolling mode not supported 01M15 holdability mode not supported -M1M16 multistatements not supported in batches -M1M17 result set not expected for DML or DDL-statement 01M18 generated keys for columns not supported -M1M19 response is not a result set -M1M20 object closed 01M21 cursors not supported -0AM21 cursors not supported 01M22 JDBC escape syntax not supported 01M23 field size limitation not supported 01M24 query time out not supported -M1M25 failed reading from/writing to object stream + +08M01 opening logfile failed 08M26 invalid URI -M0M27 unknown error +08M33 connection timed out + +0AM21 cursors not supported +0AM34 Java generics not supported + 22M28 invalid BLOB format -M0M29 assert +22M29 invalid inet format +22M30 invalid url format +22M31 invalid uuid format +22M32 invalid json format + +2BM37 dependent objects still exist +2DM30 autocommit mode active 3BM30 autocommit mode active -2DM30 autocommit mode active + 42M31 user/role already exists 42M32 user/role not found -08M33 connection timeout -0AM34 Java generics not supported 42M35 sequence not found 42M36 cannot restart sequence with NULL -2BM37 dependent objects still exist + +M0M03 illegal arguments (invalid call of internal function) +M0M04 only supported in SQL mode +M0M06 savepoint is not MonetSavepoint +M0M10 protocol violation/unexpected server response +M0M12 matching client handle referenced by server not found +M0M27 unknown error +M0M29 assert + +M1M05 invalid argument (user supplied) +M1M16 multistatements not supported in batches +M1M17 result set not expected for DML or DDL-statement +M1M19 response is not a result set +M1M20 object closed +M1M25 failed reading from/writing to object stream -TODO: -JDBC 4.1 suggests the following SQLException subclass mapping: -NonTransientSQLExeceptions (fails when same operation executed again) -0A SQLFeatureNotSupportedException -08 SQLNonTransientConnectionException -22 SQLDataException -23 SQLIntegrityConstraintViolationException -28 SQLInvalidAuthorizationException -42 SQLSyntaxErrorException -TransientSQLExeceptions (retry of same operation might succeed) -08 SQLTransientConnectionException -40 SQLTransactionRollbackException - SQLTimeoutException +SQLState codes are used in SQLExceptions. +JDBC 4.1 defines the following SQLException subclass mappings: + NonTransientSQLExceptions (fails when same operation executed again) + 0A SQLFeatureNotSupportedException + 08 SQLNonTransientConnectionException + 22 SQLDataException + 23 SQLIntegrityConstraintViolationException + 28 SQLInvalidAuthorizationSpecException + 42 SQLSyntaxErrorException + TransientSQLExeceptions (retry of same operation might succeed) + 08 SQLTransientConnectionException + 40 SQLTransactionRollbackException + null SQLTimeoutException +See also: http://docs.oracle.com/javase/7/docs/api/java/sql/SQLException.html +See also: https://en.wikibooks.org/wiki/Structured_Query_Language/SQLSTATE + diff --git a/release.txt b/release.txt --- a/release.txt +++ b/release.txt @@ -1,6 +1,6 @@ RELEASE NOTES -MonetDB JDBC driver version 2.24 (Liberica/MCL-1.14) -Release date: 2016-12-15 +MonetDB JDBC driver version 2.26 (Liberica/MCL-1.15) +Release date: 2017-07-28 This JDBC driver is designed for use with MonetDB, a main-memory database. For more information see https://www.monetdb.org/. @@ -55,8 +55,8 @@ Currently implemented JDBC 4.1 interface - setArray - setAsciiStream, setBinaryStream, setUnicodeStream - setBlob - - setNCharacterStream, setNClob, setNString - - setRef, setRowId, setSQLXML, setURL + - setNClob + - setRef, setRowId, setSQLXML * java.sql.ParameterMetaData @@ -64,9 +64,9 @@ Currently implemented JDBC 4.1 interface The next features/methods are NOT implemented: - getArray - getAsciiStream, getUnicodeStream - - getNCharacterStream, getNClob, getNString + - getNClob - getRef, getRowId, getSQLXML - - all methods related to updateable result sets + - All methods related to updateable result sets * java.sql.ResultSetMetaData @@ -83,10 +83,13 @@ Currently implemented JDBC 4.1 interface A simple implementation using a StringBuilder to store the whole CLOB The next features/methods are NOT implemented: - getAsciiStream - - getCharacterStream - setAsciiStream - setCharacterStream + * java.sql.SQLData + implemented by class: nl.cwi.monetdb.jdbc.types.INET + and by class: nl.cwi.monetdb.jdbc.types.URL + * javax.sql.DataSource (not tested) @@ -96,7 +99,6 @@ The next java.sql.* interfaces are NOT i * java.sql.NClob * java.sql.Ref * java.sql.Rowid - * java.sql.SQLData * java.sql.SQLInput * java.sql.SQLOutput * java.sql.SQLXML diff --git a/src/main/java/nl/cwi/monetdb/client/JdbcClient.java b/src/main/java/nl/cwi/monetdb/client/JdbcClient.java --- a/src/main/java/nl/cwi/monetdb/client/JdbcClient.java +++ b/src/main/java/nl/cwi/monetdb/client/JdbcClient.java @@ -54,11 +54,11 @@ import java.util.zip.GZIPInputStream; public final class JdbcClient { private static Connection con; + private static DatabaseMetaData dbmd; private static Statement stmt; private static BufferedReader in; private static PrintWriter out; private static Exporter exporter; - private static DatabaseMetaData dbmd; public static void main(String[] args) throws Exception { CmdLineOpts copts = new CmdLineOpts(); @@ -158,20 +158,21 @@ public final class JdbcClient { System.exit(1); } // we can actually compare pointers (objects) here - if (!Objects.equals(user, copts.getOption("user").getArgument())) pass = null; + if (user != copts.getOption("user").getArgument()) + pass = null; if (copts.getOption("help").isPresent()) { System.out.print( "Usage java -jar jdbcclient.jar\n" + - " [-h host[:port]] [-p port] [-f file] [-u user]\n" + - " [-l language] [-d database] [-e] [-D [table]]\n" + - " [-X<opt>]\n" + + "\t\t[-h host[:port]] [-p port] [-f file] [-u user]\n" + + "\t\t[-l language] [-d database] [-e] [-D [table]]\n" + + "\t\t[-X<opt>]\n" + "or using long option equivalents --host --port --file --user --language\n" + "--dump --echo --database.\n" + "Arguments may be written directly after the option like -p50000.\n" + "\n" + - "If no host and port are given, localhost and 50000 are assumed. An .monetdb\n" + - "file may exist in the user's home directory. This file can contain\n" + + "If no host and port are given, localhost and 50000 are assumed.\n" + + "An .monetdb file may exist in the user's home directory. This file can contain\n" + "preferences to use each time JdbcClient is started. Options given on the\n" + "command line override the preferences file. The .monetdb file syntax is\n" + "<option>=<value> where option is one of the options host, port, file, mode\n" + @@ -219,7 +220,8 @@ public final class JdbcClient { host = host + ":" + copts.getOption("port").getArgument(); } - //Class.forName("nl.cwi.monetdb.jdbc.MonetDriver"); + // make sure the driver is loaded + // Class.forName("nl.cwi.monetdb.jdbc.MonetDriver"); // not needed anymore for self registering JDBC drivers // build the extra arguments of the JDBC connect string String attr = "?"; @@ -227,12 +229,15 @@ public final class JdbcClient { String lang = oc.getArgument(); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list