Mercurial > hg > monetdb-java
comparison src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java @ 376:ffdc7b0e102d
Updated JDBC driver to comply with JDBC 4.2 interface now we compile for Java 8. This includes:
- adding 8 methods to MonetCallableStatement
- adding 2 methods to MonetDatabaseMetaData
- adding 3 methods to MonetPreparedStatement
- adding 4 methods to MonetResultSet
- adding 8 methods to MonetStatement
Some methods needs some more work, for instance getLargeUpdateCount(). This will be done in a separate checkin.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Wed, 23 Sep 2020 18:55:33 +0200 (2020-09-23) |
parents | 2ab474af487c |
children | 8a813f5cef1b |
comparison
equal
deleted
inserted
replaced
375:a229ac4e275c | 376:ffdc7b0e102d |
---|---|
2695 // {{{ ResponseList class implementation | 2695 // {{{ ResponseList class implementation |
2696 final class ResponseList { | 2696 final class ResponseList { |
2697 /** The cache size (number of rows in a DataBlockResponse object) */ | 2697 /** The cache size (number of rows in a DataBlockResponse object) */ |
2698 private final int cachesize; | 2698 private final int cachesize; |
2699 /** The maximum number of results for this query */ | 2699 /** The maximum number of results for this query */ |
2700 private final int maxrows; | 2700 private final long maxrows; |
2701 /** The ResultSet type to produce */ | 2701 /** The ResultSet type to produce */ |
2702 private final int rstype; | 2702 private final int rstype; |
2703 /** The ResultSet concurrency to produce */ | 2703 /** The ResultSet concurrency to produce */ |
2704 private final int rsconcur; | 2704 private final int rsconcur; |
2705 /** The sequence number of this ResponseList */ | 2705 /** The sequence number of this ResponseList */ |
2724 * @param rstype the type of result sets to produce | 2724 * @param rstype the type of result sets to produce |
2725 * @param rsconcur the concurrency of result sets to produce | 2725 * @param rsconcur the concurrency of result sets to produce |
2726 */ | 2726 */ |
2727 ResponseList( | 2727 ResponseList( |
2728 final int cachesize, | 2728 final int cachesize, |
2729 final int maxrows, | 2729 final long maxrows, |
2730 final int rstype, | 2730 final int rstype, |
2731 final int rsconcur | 2731 final int rsconcur |
2732 ) throws SQLException { | 2732 ) throws SQLException { |
2733 this.cachesize = cachesize; | 2733 this.cachesize = cachesize; |
2734 this.maxrows = maxrows; | 2734 this.maxrows = maxrows; |
2856 * then ignore this call. If it is set to 0 we get a | 2856 * then ignore this call. If it is set to 0 we get a |
2857 * prompt after the server sent it's header. | 2857 * prompt after the server sent it's header. |
2858 */ | 2858 */ |
2859 int size = (cachesize == 0 ? DEF_FETCHSIZE : cachesize); | 2859 int size = (cachesize == 0 ? DEF_FETCHSIZE : cachesize); |
2860 if (maxrows > 0 && maxrows < size) | 2860 if (maxrows > 0 && maxrows < size) |
2861 size = maxrows; | 2861 size = (int)maxrows; |
2862 // don't do work if it's not needed | 2862 // don't do work if it's not needed |
2863 if (lang == LANG_SQL && size != curReplySize && templ != commandTempl) { | 2863 if (lang == LANG_SQL && size != curReplySize && templ != commandTempl) { |
2864 sendControlCommand("reply_size " + size); | 2864 sendControlCommand("reply_size " + size); |
2865 | 2865 |
2866 // store the reply size after a successful change | 2866 // store the reply size after a successful change |
2885 case StartOfHeaderParser.Q_PARSE: | 2885 case StartOfHeaderParser.Q_PARSE: |
2886 throw new MCLParseException("Q_PARSE header not allowed here", 1); | 2886 throw new MCLParseException("Q_PARSE header not allowed here", 1); |
2887 case StartOfHeaderParser.Q_TABLE: | 2887 case StartOfHeaderParser.Q_TABLE: |
2888 case StartOfHeaderParser.Q_PREPARE: { | 2888 case StartOfHeaderParser.Q_PREPARE: { |
2889 final int id = sohp.getNextAsInt(); | 2889 final int id = sohp.getNextAsInt(); |
2890 int tuplecount = sohp.getNextAsInt(); | 2890 int tuplecount = sohp.getNextAsInt(); // TODO implement StartOfHeaderParser.getNextAsLong() and change tuplecount to long |
2891 final int columncount = sohp.getNextAsInt(); | 2891 final int columncount = sohp.getNextAsInt(); |
2892 final int rowcount = sohp.getNextAsInt(); | 2892 final int rowcount = sohp.getNextAsInt(); |
2893 // enforce the maxrows setting | 2893 // enforce the maxrows setting |
2894 if (maxrows != 0 && tuplecount > maxrows) | 2894 if (maxrows != 0 && tuplecount > maxrows) |
2895 tuplecount = maxrows; | 2895 tuplecount = (int)maxrows; |
2896 res = new ResultSetResponse(id, tuplecount, columncount, rowcount, this, seqnr); | 2896 res = new ResultSetResponse(id, tuplecount, columncount, rowcount, this, seqnr); |
2897 // only add this resultset to the hashmap if it can possibly have an additional datablock | 2897 // only add this resultset to the hashmap if it can possibly have an additional datablock |
2898 if (rowcount < tuplecount) { | 2898 if (rowcount < tuplecount) { |
2899 if (rsresponses == null) | 2899 if (rsresponses == null) |
2900 rsresponses = new HashMap<Integer, ResultSetResponse>(); | 2900 rsresponses = new HashMap<Integer, ResultSetResponse>(); |