comparison src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java @ 271:4880267d0fe1

Added implementation of java.sql.CallableStatement interface, test program and updated the ChangeLog and release notes. This implementation resolves request: https://www.monetdb.org/bugzilla/show_bug.cgi?id=6402
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 21 Mar 2019 18:57:07 +0100 (2019-03-21)
parents eefa7f625673
children 4face9f42efc 1d6062d94377
comparison
equal deleted inserted replaced
270:926afbe567f5 271:4880267d0fe1
154 154
155 // Internal cache for determining if system table sys.comments (new as of Mar2018 release) exists on server 155 // Internal cache for determining if system table sys.comments (new as of Mar2018 release) exists on server
156 private boolean queriedCommentsTable = false; 156 private boolean queriedCommentsTable = false;
157 private boolean hasCommentsTable = false; 157 private boolean hasCommentsTable = false;
158 158
159 /** The last set query timeout on the server as used by Statement and PreparedStatement (and CallableStatement in future) */ 159 /** The last set query timeout on the server as used by Statement, PreparedStatement and CallableStatement */
160 protected int lastSetQueryTimeout = 0; // 0 means no timeout, which is the default on the server 160 protected int lastSetQueryTimeout = 0; // 0 means no timeout, which is the default on the server
161 161
162 162
163 /** 163 /**
164 * Constructor of a Connection for MonetDB. At this moment the 164 * Constructor of a Connection for MonetDB. At this moment the
500 statements.put(ret, null); 500 statements.put(ret, null);
501 return ret; 501 return ret;
502 } catch (IllegalArgumentException e) { 502 } catch (IllegalArgumentException e) {
503 throw new SQLException(e.toString(), "M0M03"); 503 throw new SQLException(e.toString(), "M0M03");
504 } 504 }
505 // we don't have to catch SQLException because that is declared to 505 // we don't have to catch SQLException because that is declared to be thrown
506 // be thrown
507 } 506 }
508 507
509 /** 508 /**
510 * Retrieves the current auto-commit mode for this Connection object. 509 * Retrieves the current auto-commit mode for this Connection object.
511 * 510 *
724 */ 723 */
725 @Override 724 @Override
726 public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) 725 public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
727 throws SQLException 726 throws SQLException
728 { 727 {
729 throw newSQLFeatureNotSupportedException("prepareCall"); 728 try {
730 /* a request to implement prepareCall() has already been logged, see https://www.monetdb.org/bugzilla/show_bug.cgi?id=6402 */ 729 CallableStatement ret = new MonetCallableStatement(
730 this,
731 resultSetType,
732 resultSetConcurrency,
733 resultSetHoldability,
734 sql
735 );
736 // store it in the map for when we close...
737 statements.put(ret, null);
738 return ret;
739 } catch (IllegalArgumentException e) {
740 throw new SQLException(e.toString(), "M0M03");
741 }
742 // we don't have to catch SQLException because that is declared to be thrown
731 } 743 }
732 744
733 /** 745 /**
734 * Creates a PreparedStatement object for sending parameterized SQL 746 * Creates a PreparedStatement object for sending parameterized SQL
735 * statements to the database. 747 * statements to the database.