comparison src/main/java/org/monetdb/jdbc/MonetConnection.java @ 562:c640075da7c9 onclient

only comment improvements
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Wed, 22 Sep 2021 18:09:18 +0200 (2021-09-22)
parents 7f10d662a788
children fa2493d924c8
comparison
equal deleted inserted replaced
561:028d4f388bae 562:c640075da7c9
1673 } 1673 }
1674 } 1674 }
1675 1675
1676 //== end methods of interface java.sql.Connection 1676 //== end methods of interface java.sql.Connection
1677 1677
1678
1679 //== internal helper methods which do not belong to the JDBC interface
1680
1678 /** 1681 /**
1679 * Registers a {@link UploadHandler} to support for example COPY ON CLIENT 1682 * Registers a {@link UploadHandler} to support for example COPY ON CLIENT
1680 * 1683 *
1681 * @param uploadHandler the handler to register, or null to deregister 1684 * @param uploadHandler the handler to register, or null to deregister
1682 */ 1685 */
1703 * Returns the currently registerered {@link DownloadHandler} handler, or null 1706 * Returns the currently registerered {@link DownloadHandler} handler, or null
1704 */ 1707 */
1705 public DownloadHandler getDownloadHandler() { 1708 public DownloadHandler getDownloadHandler() {
1706 return downloadHandler; 1709 return downloadHandler;
1707 } 1710 }
1708
1709
1710 //== internal helper methods which do not belong to the JDBC interface
1711 1711
1712 /** 1712 /**
1713 * Local helper method to test whether the Connection object is closed 1713 * Local helper method to test whether the Connection object is closed
1714 * When closed it throws an SQLException 1714 * When closed it throws an SQLException
1715 */ 1715 */
2151 * 2151 *
2152 * @throws SQLException if the contents of the Response is not 2152 * @throws SQLException if the contents of the Response is not
2153 * consistent or sufficient. 2153 * consistent or sufficient.
2154 */ 2154 */
2155 /* MvD: disabled not used/needed code 2155 /* MvD: disabled not used/needed code
2156 public abstract void complete() throws SQLException; 2156 void complete() throws SQLException;
2157 */ 2157 */
2158 2158
2159 /** 2159 /**
2160 * Instructs the Response implementation to close and do the 2160 * Instructs the Response implementation to close and do the
2161 * necessary clean up procedures. 2161 * necessary clean up procedures.
3335 3335
3336 /** 3336 /**
3337 * Send an error message to the server 3337 * Send an error message to the server
3338 * 3338 *
3339 * The server will generally let the currently executing statement fail 3339 * The server will generally let the currently executing statement fail
3340 * with this error message. The connection will remain usable. 3340 * with this error message. The connection will remain usable.
3341 * 3341 *
3342 * This method can only be sent if no data has been sent to the server 3342 * This method can only be sent if no data has been sent to the server
3343 * yet. After data has been sent, you can still throw an 3343 * yet. After data has been sent, you can still throw an
3344 * {@link IOException} but this will terminate the connection. 3344 * {@link IOException} but this will terminate the connection.
3345 * @param errorMessage error message to send 3345 * @param errorMessage error message to send
3395 return error; 3395 return error;
3396 } 3396 }
3397 3397
3398 /** 3398 /**
3399 * Read from the given input stream and write it to the server. 3399 * Read from the given input stream and write it to the server.
3400 * 3400 *
3401 * For text mode uploads, the data MUST be validly UTF-8 encoded. 3401 * For text mode uploads, the data MUST be validly UTF-8 encoded.
3402 */ 3402 */
3403 public void uploadFrom(InputStream inputStream) throws IOException { 3403 public void uploadFrom(InputStream inputStream) throws IOException {
3404 OutputStream s = getStream(); 3404 OutputStream s = getStream();
3405 byte[] buffer = new byte[64 * 1024]; 3405 byte[] buffer = new byte[64 * 1024];
3476 * with this error message. The connection will remain usable. 3476 * with this error message. The connection will remain usable.
3477 * 3477 *
3478 * This method can only be sent if no data has been received from the server 3478 * This method can only be sent if no data has been received from the server
3479 * yet. After data has been received, you can still throw an 3479 * yet. After data has been received, you can still throw an
3480 * {@link IOException} but this will terminate the connection. 3480 * {@link IOException} but this will terminate the connection.
3481 * 3481 *
3482 * Note: as of MonetDB version Jul2021 the server always terminates the connection 3482 * Note: as of MonetDB version Jul2021 the server always terminates the connection
3483 * when this error is used. This will probably change in the future. 3483 * when this error is used. This will probably change in the future.
3484 */ 3484 */
3485 public void sendError(String errorMessage) throws IOException { 3485 public void sendError(String errorMessage) throws IOException {
3486 if (error != null) { 3486 if (error != null) {
3489 error = errorMessage; 3489 error = errorMessage;
3490 } 3490 }
3491 3491
3492 /** 3492 /**
3493 * Get an {@link InputStream} to read data from. 3493 * Get an {@link InputStream} to read data from.
3494 * 3494 *
3495 * Textual data is UTF-8 encoded. 3495 * Textual data is UTF-8 encoded.
3496 */ 3496 */
3497 public InputStream getStream() throws IOException { 3497 public InputStream getStream() throws IOException {
3498 if (error != null) { 3498 if (error != null) {
3499 throw new IOException("cannot receive data after error has been sent"); 3499 throw new IOException("cannot receive data after error has been sent");