changeset 262:2d62ca1f758b

Moved utility method newSQLFeatureNotSupportedException(String name) from MonetPreparedStatement.java and MonetResultSet.java to class MonetWrapper such that it can be called directly from all classes which extend MonetWrapper. Call MonetWrapper.newSQLFeatureNotSupportedException() from more classes and places. Update java documentation: - add "@throws SQLFeatureNotSupportedException" to methods which can throw it - remove "@throws SQLFeatureNotSupportedException" from methods which do not throw it
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 03 Jan 2019 18:33:25 +0100 (2019-01-03)
parents d4baf8a4b43a
children 8fbed4aeff0e
files 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/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/MonetWrapper.java
diffstat 8 files changed, 95 insertions(+), 136 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetBlob.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetBlob.java
@@ -13,7 +13,6 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.sql.Blob;
 import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
 
 /**
  * The MonetBlob class implements the {@link java.sql.Blob} interface.
@@ -239,7 +238,7 @@ public final class MonetBlob implements 
 	 */
 	@Override
 	public OutputStream setBinaryStream(long pos) throws SQLException {
-		throw new SQLFeatureNotSupportedException("Method setBinaryStream(long pos) not supported", "0A000");
+		throw MonetWrapper.newSQLFeatureNotSupportedException("setBinaryStream");
 	}
 
 	/**
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java
@@ -15,7 +15,6 @@ import java.io.StringReader;
 import java.io.Writer;
 import java.sql.Clob;
 import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
 
 /**
  * The MonetClob class implements the {@link java.sql.Clob} interface.
@@ -71,7 +70,7 @@ public final class MonetClob implements 
 	 */
 	@Override
 	public InputStream getAsciiStream() throws SQLException {
-		throw new SQLFeatureNotSupportedException("Method getAsciiStream() not supported", "0A000");
+		throw MonetWrapper.newSQLFeatureNotSupportedException("getAsciiStream");
 	}
 
 	/**
@@ -221,7 +220,7 @@ public final class MonetClob implements 
 	 */
 	@Override
 	public OutputStream setAsciiStream(long pos) throws SQLException {
-		throw new SQLFeatureNotSupportedException("Method setAsciiStream(long pos) not supported", "0A000");
+		throw MonetWrapper.newSQLFeatureNotSupportedException("setAsciiStream");
 	}
 
 	/**
@@ -242,7 +241,7 @@ public final class MonetClob implements 
 	 */
 	@Override
 	public Writer setCharacterStream(long pos) throws SQLException {
-		throw new SQLFeatureNotSupportedException("Method setCharacterStream(long pos) not supported", "0A000");
+		throw MonetWrapper.newSQLFeatureNotSupportedException("setCharacterStream");
 	}
 
 	/**
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
@@ -20,7 +20,6 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLClientInfoException;
 import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
 import java.sql.SQLNonTransientConnectionException;
 import java.sql.SQLWarning;
 import java.sql.Savepoint;
@@ -513,7 +512,7 @@ public class MonetConnection
 	 * @see #setAutoCommit(boolean)
 	 */
 	@Override
-	public boolean getAutoCommit() throws SQLException {
+	public boolean getAutoCommit() {
 		return autoCommit;
 	}
 
@@ -521,11 +520,9 @@ public class MonetConnection
 	 * Retrieves this Connection object's current catalog name.
 	 *
 	 * @return the current catalog name or null if there is none
-	 * @throws SQLException if a database access error occurs or the
-	 *         current language is not SQL
 	 */
 	@Override
-	public String getCatalog() throws SQLException {
+	public String getCatalog() {
 		// MonetDB does NOT support catalogs
 		return null;
 	}
@@ -653,10 +650,8 @@ public class MonetConnection
 	 * A driver may convert the JDBC SQL grammar into its system's native SQL grammar prior to sending it.
 	 * This method returns the native form of the statement that the driver would have sent.
 	 *
-	 * Parameters:
-	 *   sql - an SQL statement that may contain one or more '?' parameter placeholders.
-	 * Returns: the native form of this statement
-	 * Throws: SQLException - if a database access error occurs or this method is called on a closed connection
+	 * @param sql - an SQL statement that may contain one or more '?' parameter placeholders.
+	 * @return the native form of this statement
 	 */
 	@Override
 	public String nativeSQL(String sql) {
@@ -679,11 +674,11 @@ public class MonetConnection
 	 * and have a concurrency level of CONCUR_READ_ONLY.
 	 * The holdability of the created result sets can be determined by calling getHoldability().
 	 *
-	 * Parameters:
-	 *   sql - an SQL statement that may contain one or more '?' parameter placeholders.
+	 * @param sql - an SQL statement that may contain one or more '?' parameter placeholders.
 	 *	Typically this statement is specified using JDBC call escape syntax.
-	 * Returns: a new default CallableStatement object containing the pre-compiled SQL statement
-	 * Throws: SQLException - if a database access error occurs or this method is called on a closed connection
+	 * @return a new default CallableStatement object containing the pre-compiled SQL statement
+	 * @throws SQLException - if a database access error occurs or this method is called on a closed connection
+	 * @throws SQLFeatureNotSupportedException - if the JDBC driver does not support this method.
 	 */
 	@Override
 	public CallableStatement prepareCall(String sql) throws SQLException {
@@ -695,18 +690,16 @@ public class MonetConnection
 	 * This method is the same as the prepareCall method above, but it allows the default result set type and concurrency to be overridden.
 	 * The holdability of the created result sets can be determined by calling getHoldability().
 	 *
-	 * Parameters:
-	 *   sql - a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
+	 * @param sql - a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
 	 *	Typically this statement is specified using JDBC call escape syntax.
-	 *   resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
-	 *   resultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
-	 * Returns: a new CallableStatement object containing the pre-compiled SQL statement that
+	 * @param resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
+	 * @param resultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
+	 * @return a new CallableStatement object containing the pre-compiled SQL statement that
 	 *	will produce ResultSet objects with the given type and concurrency
-	 * Throws:
-	 *   SQLException - if a database access error occurs, this method is called on a closed connection or
-	 *		the given parameters are not ResultSet constants indicating type and concurrency
-	 *   SQLFeatureNotSupportedException - if the JDBC driver does not support this method or
-	 *		this method is not supported for the specified result set type and result set concurrency.
+	 * @throws SQLException - if a database access error occurs, this method is called on a closed connection or
+	 *	the given parameters are not ResultSet constants indicating type and concurrency
+	 * @throws SQLFeatureNotSupportedException - if the JDBC driver does not support this method or
+	 *	this method is not supported for the specified result set type and result set concurrency.
 	 */
 	@Override
 	public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
@@ -717,24 +710,22 @@ public class MonetConnection
 	 * Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
 	 * This method is the same as the prepareCall method above, but it allows the default result set type, result set concurrency type and holdability to be overridden.
 	 *
-	 * Parameters:
-	 *   sql - a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
+	 * @param sql - a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
 	 *	Typically this statement is specified using JDBC call escape syntax.
-	 *   resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
-	 *   resultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
-	 *   resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
-	 * Returns: a new CallableStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability
-	 * Throws:
-	 *   SQLException - if a database access error occurs, this method is called on a closed connection or
-	 *		the given parameters are not ResultSet constants indicating type, concurrency, and holdability
-	 *   SQLFeatureNotSupportedException - if the JDBC driver does not support this method or
-	 *		this method is not supported for the specified result set type, result set holdability and result set concurrency.
+	 * @param resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
+	 * @param resultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
+	 * @param resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
+	 * @return a new CallableStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability
+	 * @throws SQLException - if a database access error occurs, this method is called on a closed connection or
+	 *	the given parameters are not ResultSet constants indicating type, concurrency, and holdability
+	 * @throws SQLFeatureNotSupportedException - if the JDBC driver does not support this method or
+	 *	this method is not supported for the specified result set type, result set holdability and result set concurrency.
 	 */
 	@Override
 	public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
 		throws SQLException
 	{
-		throw new SQLFeatureNotSupportedException("prepareCall() not yet supported", "0A000");
+		throw newSQLFeatureNotSupportedException("prepareCall");
 		/* a request to implement prepareCall() has already been logged, see https://www.monetdb.org/bugzilla/show_bug.cgi?id=6402 */
 	}
 
@@ -839,8 +830,7 @@ public class MonetConnection
 		} catch (IllegalArgumentException e) {
 			throw new SQLException(e.toString(), "M0M03");
 		}
-		// we don't have to catch SQLException because that is declared to
-		// be thrown
+		// we don't have to catch SQLException because that is declared to be thrown
 	}
 
 	/**
@@ -879,11 +869,10 @@ public class MonetConnection
 	@Override
 	public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
 		if (autoGeneratedKeys != Statement.RETURN_GENERATED_KEYS &&
-			autoGeneratedKeys != Statement.NO_GENERATED_KEYS)
+		    autoGeneratedKeys != Statement.NO_GENERATED_KEYS)
 			throw new SQLException("Invalid argument, expected RETURN_GENERATED_KEYS or NO_GENERATED_KEYS", "M1M05");
 
-		/* MonetDB has no way to disable this, so just do the normal
-		 * thing ;) */
+		/* MonetDB has no way to disable this, so just do the normal thing ;) */
 		return prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
 	}
 
@@ -904,19 +893,16 @@ public class MonetConnection
 	 * Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have
 	 * a concurrency level of CONCUR_READ_ONLY. The holdability of the created result sets can be determined by calling getHoldability().
 	 *
-	 * Parameters:
-	 *     sql - an SQL statement that may contain one or more '?' IN parameter placeholders
-	 *     columnIndexes - an array of column indexes indicating the columns that should be returned from the inserted row or rows
-	 * Returns:
-	 *     a new PreparedStatement object, containing the pre-compiled statement, that is capable of
-	 *     returning the auto-generated keys designated by the given array of column indexes
-	 * Throws:
-	 *     SQLException - if a database access error occurs or this method is called on a closed connection
-	 *     SQLFeatureNotSupportedException - if the JDBC driver does not support this method
+	 * @param sql - an SQL statement that may contain one or more '?' IN parameter placeholders
+	 * @param columnIndexes - an array of column indexes indicating the columns that should be returned from the inserted row or rows
+	 * @return a new PreparedStatement object, containing the pre-compiled statement, that is capable of
+	 * 	returning the auto-generated keys designated by the given array of column indexes
+	 * @throws SQLException - if a database access error occurs or this method is called on a closed connection
+	 * @throws SQLFeatureNotSupportedException - if the JDBC driver does not support this method
 	 */
 	@Override
 	public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
-		throw new SQLFeatureNotSupportedException("prepareStatement(String sql, int[] columnIndexes) not supported", "0A000");
+		throw newSQLFeatureNotSupportedException("prepareStatement(String sql, int[] columnIndexes)");
 	}
 
 	/**
@@ -936,19 +922,16 @@ public class MonetConnection
 	 * Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have
 	 * a concurrency level of CONCUR_READ_ONLY. The holdability of the created result sets can be determined by calling getHoldability().
 	 *
-	 * Parameters:
-	 *     sql - an SQL statement that may contain one or more '?' IN parameter placeholders
-	 *     columnNames - an array of column names indicating the columns that should be returned from the inserted row or rows
-	 * Returns:
-	 *     a new PreparedStatement object, containing the pre-compiled statement, that is capable of
-	 *     returning the auto-generated keys designated by the given array of column names
-	 * Throws:
-	 *     SQLException - if a database access error occurs or this method is called on a closed connection
-	 *     SQLFeatureNotSupportedException - if the JDBC driver does not support this method
+	 * @param sql - an SQL statement that may contain one or more '?' IN parameter placeholders
+	 * @param columnNames - an array of column names indicating the columns that should be returned from the inserted row or rows
+	 * @return a new PreparedStatement object, containing the pre-compiled statement, that is capable of
+	 * 	returning the auto-generated keys designated by the given array of column names
+	 * @throws SQLException - if a database access error occurs or this method is called on a closed connection
+	 * @throws SQLFeatureNotSupportedException - if the JDBC driver does not support this method
 	 */
 	@Override
 	public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
-		throw new SQLFeatureNotSupportedException("prepareStatement(String sql, String[] columnNames) not supported", "0A000");
+		throw newSQLFeatureNotSupportedException("prepareStatement(String sql, String[] columnNames)");
 	}
 
 	/**
@@ -1049,7 +1032,7 @@ public class MonetConnection
 	 * does not support catalogs, it will silently ignore this request.
 	 */
 	@Override
-	public void setCatalog(String catalog) throws SQLException {
+	public void setCatalog(String catalog) {
 		// silently ignore this request as MonetDB does not support catalogs
 	}
 
@@ -1061,13 +1044,15 @@ public class MonetConnection
 	 * @param holdability - a ResultSet holdability constant; one of
 	 *	ResultSet.HOLD_CURSORS_OVER_COMMIT or
 	 *	ResultSet.CLOSE_CURSORS_AT_COMMIT
+	 * @throws SQLException - if a database access error occurs or this method is called on a closed connection
+	 * @throws SQLFeatureNotSupportedException - if the JDBC driver does not support this method or argument
 	 * @see #getHoldability()
 	 */
 	@Override
 	public void setHoldability(int holdability) throws SQLException {
 		// we only support ResultSet.HOLD_CURSORS_OVER_COMMIT
 		if (holdability != ResultSet.HOLD_CURSORS_OVER_COMMIT)
-			throw new SQLFeatureNotSupportedException("setHoldability(CLOSE_CURSORS_AT_COMMIT) not supported", "0A000");
+			throw newSQLFeatureNotSupportedException("setHoldability(CLOSE_CURSORS_AT_COMMIT)");
 	}
 
 	/**
@@ -1205,7 +1190,7 @@ public class MonetConnection
 	 */
 	@Override
 	public java.sql.Array createArrayOf(String typeName, Object[] elements) throws SQLException {
-		throw new SQLFeatureNotSupportedException("createArrayOf() not supported", "0A000");
+		throw newSQLFeatureNotSupportedException("createArrayOf");
 	}
 
 
@@ -1256,7 +1241,7 @@ public class MonetConnection
 	 */
 	@Override
 	public java.sql.NClob createNClob() throws SQLException {
-		throw new SQLFeatureNotSupportedException("createNClob() not supported", "0A000");
+		throw newSQLFeatureNotSupportedException("createNClob");
 	}
 
 	/**
@@ -1276,7 +1261,7 @@ public class MonetConnection
 	 */
 	@Override
 	public java.sql.Struct createStruct(String typeName, Object[] attributes) throws SQLException {
-		throw new SQLFeatureNotSupportedException("createStruct() not supported", "0A000");
+		throw newSQLFeatureNotSupportedException("createStruct");
 	}
 
 	/**
@@ -1293,7 +1278,7 @@ public class MonetConnection
 	 */
 	@Override
 	public java.sql.SQLXML createSQLXML() throws SQLException {
-		throw new SQLFeatureNotSupportedException("createSQLXML() not supported", "0A000");
+		throw newSQLFeatureNotSupportedException("createSQLXML");
 	}
 
 	/**
@@ -1885,8 +1870,6 @@ public class MonetConnection
 		/**
 		 * Instructs the Response implementation to close and do the
 		 * necessary clean up procedures.
-		 *
-		 * @throws SQLException
 		 */
 		public abstract void close();
 	}
@@ -2408,8 +2391,6 @@ public class MonetConnection
 		/**
 		 * Instructs the Response implementation to close and do the
 		 * necessary clean up procedures.
-		 *
-		 * @throws SQLException
 		 */
 		@Override
 		public void close() {
@@ -2592,7 +2573,8 @@ public class MonetConnection
 				// free resources if we're running forward only
 				if (curResponse >= 0 && curResponse < responses.size()) {
 					Response tmp = responses.get(curResponse);
-					if (tmp != null) tmp.close();
+					if (tmp != null)
+						tmp.close();
 					responses.set(curResponse, null);
 				}
 			}
@@ -2613,7 +2595,8 @@ public class MonetConnection
 		 * @param i the index position of the header to close
 		 */
 		void closeResponse(int i) {
-			if (i < 0 || i >= responses.size()) return;
+			if (i < 0 || i >= responses.size())
+				return;
 			Response tmp = responses.set(i, null);
 			if (tmp != null)
 				tmp.close();
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetDataSource.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetDataSource.java
@@ -215,6 +215,6 @@ public class MonetDataSource extends Mon
 	 */
 	@Override
 	public Logger getParentLogger() throws SQLFeatureNotSupportedException {
-		throw new SQLFeatureNotSupportedException("java.util.logging not in use", "0A000");
+		throw newSQLFeatureNotSupportedException("getParentLogger");
 	}
 }
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in
@@ -316,7 +316,7 @@ final public class MonetDriver implement
 	 */
 	@Override
 	public Logger getParentLogger() throws SQLFeatureNotSupportedException {
-		throw new SQLFeatureNotSupportedException("java.util.logging not in use", "0A000");
+		throw MonetWrapper.newSQLFeatureNotSupportedException("getParentLogger");
 	}
 
 	//== end methods of interface driver
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
@@ -29,7 +29,6 @@ import java.sql.RowId;
 import java.sql.SQLData;
 import java.sql.SQLDataException;
 import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
 import java.sql.SQLOutput;
 import java.sql.SQLXML;
 import java.sql.Struct;
@@ -965,6 +964,8 @@ public class MonetPreparedStatement
 	 * @param parameterIndex the first parameter is 1, the second is 2, ...
 	 * @param x an Array object that maps an SQL ARRAY value
 	 * @throws SQLException if a database access error occurs
+	 * @throws SQLFeatureNotSupportedException the JDBC driver does
+	 *         not support this method
 	 */
 	@Override
 	public void setArray(int parameterIndex, Array x) throws SQLException {
@@ -1010,6 +1011,8 @@ public class MonetPreparedStatement
 	 * @param x the Java input stream that contains the ASCII parameter value
 	 * @param length the number of bytes in the stream
 	 * @throws SQLException if a database access error occurs
+	 * @throws SQLFeatureNotSupportedException the JDBC driver does
+	 *         not support this method
 	 */
 	@Override
 	public void setAsciiStream(int parameterIndex, InputStream x, int length)
@@ -1310,8 +1313,6 @@ public class MonetPreparedStatement
 	 * @param parameterIndex the first parameter is 1, the second is 2, ...
 	 * @param reader the java.io.Reader object that contains the Unicode data
 	 * @throws SQLException if a database access error occurs
-	 * @throws SQLFeatureNotSupportedException the JDBC driver does
-	 *         not support this method
 	 */
 	@Override
 	public void setCharacterStream(int parameterIndex, Reader reader)
@@ -1376,8 +1377,6 @@ public class MonetPreparedStatement
 	 * @param reader an object that contains the data to set the parameter
 	 *          value to
 	 * @throws SQLException if a database access error occurs
-	 * @throws SQLFeatureNotSupportedException the JDBC driver does
-	 *         not support this method
 	 */
 	@Override
 	public void setClob(int parameterIndex, Reader reader) throws SQLException {
@@ -1548,8 +1547,6 @@ public class MonetPreparedStatement
 	 * @param parameterIndex the first parameter is 1, the second is 2, ...
 	 * @param value the parameter value
 	 * @throws SQLException if a database access error occurs
-	 * @throws SQLFeatureNotSupportedException the JDBC driver does
-	 *         not support this method
 	 */
 	@Override
 	public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
@@ -1566,8 +1563,6 @@ public class MonetPreparedStatement
 	 * @param value the parameter value
 	 * @param length the number of characters in the parameter data.
 	 * @throws SQLException if a database access error occurs
-	 * @throws SQLFeatureNotSupportedException the JDBC driver does
-	 *         not support this method
 	 */
 	@Override
 	public void setNCharacterStream(int parameterIndex, Reader value, long length)
@@ -1641,8 +1636,6 @@ public class MonetPreparedStatement
 	 * @param parameterIndex the first parameter is 1, the second is 2, ...
 	 * @param value the parameter value
 	 * @throws SQLException if a database access error occurs
-	 * @throws SQLFeatureNotSupportedException the JDBC driver does
-	 *         not support this method
 	 */
 	@Override
 	public void setNString(int parameterIndex, String value) throws SQLException {
@@ -1777,6 +1770,8 @@ public class MonetPreparedStatement
 	 *              reader.  For all other types, this value will be
 	 *              ignored.
 	 * @throws SQLException if a database access error occurs
+	 * @throws SQLFeatureNotSupportedException the JDBC driver does
+	 *         not support this method
 	 * @see Types
 	 */
 	@Override
@@ -2567,6 +2562,8 @@ public class MonetPreparedStatement
 	 *          parameter value as two-byte Unicode characters
 	 * @param length the number of bytes in the stream
 	 * @throws SQLException if a database access error occurs
+	 * @throws SQLFeatureNotSupportedException the JDBC driver does
+	 *         not support this method
 	 */
 	@Override
 	@Deprecated
@@ -2688,16 +2685,4 @@ public class MonetPreparedStatement
 	private static final SQLDataException newSQLInvalidParameterIndexException(int paramIdx) {
 		return new SQLDataException("Invalid Parameter Index number: " + paramIdx, "22010");
 	}
-
-	/**
-	 * Small helper method that formats the "Method ... not implemented" message
-	 * and creates a new SQLFeatureNotSupportedException object
-	 * whose SQLState is set to "0A000": feature not supported.
-	 *
-	 * @param name the method name
-	 * @return a new created SQLFeatureNotSupportedException object with SQLState 0A000
-	 */
-	private static final SQLFeatureNotSupportedException newSQLFeatureNotSupportedException(String name) {
-		return new SQLFeatureNotSupportedException("Method " + name + " not implemented", "0A000");
-	}
 }
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
@@ -32,7 +32,6 @@ import java.sql.RowId;
 import java.sql.SQLData;
 import java.sql.SQLDataException;
 import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
 import java.sql.SQLInput;
 import java.sql.SQLWarning;
 import java.sql.SQLXML;
@@ -519,8 +518,6 @@ public class MonetResultSet
 	 *         if the value is SQL NULL, the value returned is null in
 	 *         the Java programming language.
 	 * @throws SQLException if a database access error occurs
-	 * @throws SQLFeatureNotSupportedException the JDBC driver does
-	 *         not support this method
 	 */
 	@Override
 	public Reader getNCharacterStream(int columnIndex) throws SQLException {
@@ -538,8 +535,6 @@ public class MonetResultSet
 	 *         if the value is SQL NULL, the value returned is null in
 	 *         the Java programming language.
 	 * @throws SQLException if a database access error occurs
-	 * @throws SQLFeatureNotSupportedException the JDBC driver does
-	 *         not support this method
 	 */
 	@Override
 	public Reader getNCharacterStream(String columnLabel) throws SQLException {
@@ -2268,6 +2263,8 @@ public class MonetResultSet
 	 *         null or another error occurs. The getCause() method of
 	 *         the exception may provide a more detailed exception, for
 	 *         example, if a conversion error occurs
+	 * @throws SQLFeatureNotSupportedException the JDBC driver does
+	 *         not support this method
 	 */
 	@Override
 	public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
@@ -2275,7 +2272,7 @@ public class MonetResultSet
 		if (type == null)
 			throw new SQLException("type is null", "M1M05");
 
-		throw new SQLFeatureNotSupportedException("cannot return a Java generic type based on static types from getXXX methods", "0AM34");
+		throw newSQLFeatureNotSupportedException("getObject(column, Class<T> type)");
 	}
 
 	/**
@@ -2295,11 +2292,11 @@ public class MonetResultSet
 	 *         null or another error occurs. The getCause() method of
 	 *         the exception may provide a more detailed exception, for
 	 *         example, if a conversion error occurs
+	 * @throws SQLFeatureNotSupportedException the JDBC driver does
+	 *         not support this method
 	 */
 	@Override
-	public <T> T getObject(String columnLabel, Class<T> type)
-		throws SQLException
-	{
+	public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
 		return getObject(findColumn(columnLabel), type);
 	}
 
@@ -2552,8 +2549,6 @@ public class MonetResultSet
 	 * @param columnIndex the first column is 1, the second is 2, ...
 	 * @return the column value; if the value is SQL NULL, the value returned is null
 	 * @throws SQLException if there is no such column
-	 * @throws SQLFeatureNotSupportedException the JDBC driver does
-	 *         not support this method
 	 */
 	@Override
 	public String getNString(int columnIndex) throws SQLException {
@@ -2569,8 +2564,6 @@ public class MonetResultSet
 	 * @param columnLabel the SQL name of the column
 	 * @return the column value; if the value is SQL NULL, the value returned is null
 	 * @throws SQLException if the ResultSet object does not contain columnLabel
-	 * @throws SQLFeatureNotSupportedException the JDBC driver does
-	 *         not support this method
 	 */
 	@Override
 	public String getNString(String columnLabel) throws SQLException {
@@ -3309,7 +3302,6 @@ public class MonetResultSet
 	 *
 	 * Throws:
 	 *     SQLException - if a database access error occurs or this method is called on a closed result set
-	 *     SQLFeatureNotSupportedException - if the JDBC driver does not support this method
 	 * Since: 1.2
 	 * See Also: DatabaseMetaData.deletesAreDetected(int)
 	 */
@@ -3329,7 +3321,6 @@ public class MonetResultSet
 	 *
 	 * Throws:
 	 *     SQLException - if a database access error occurs or this method is called on a closed result set
-	 *     SQLFeatureNotSupportedException - if the JDBC driver does not support this method
 	 * Since: 1.2
 	 * See Also: DatabaseMetaData.insertsAreDetected(int)
 	 */
@@ -3349,7 +3340,6 @@ public class MonetResultSet
 	 *
 	 * Throws:
 	 *     SQLException - if a database access error occurs or this method is called on a closed result set
-	 *     SQLFeatureNotSupportedException - if the JDBC driver does not support this method
 	 * Since: 1.2
 	 * See Also: DatabaseMetaData.updatesAreDetected(int)
 	 */
@@ -3359,8 +3349,10 @@ public class MonetResultSet
 		return false;
 	}
 
-	/* the next methods are all related to updateable result sets, which we
-	   currently do not support */
+
+	/* Next methods are all related to updateable result sets, which we do not support.
+	 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
+	 */
 	@Override
 	public void cancelRowUpdates() throws SQLException {
 		throw newSQLFeatureNotSupportedException("cancelRowUpdates");
@@ -3403,7 +3395,7 @@ public class MonetResultSet
 	}
 
 	@Override
-	public void updateAsciiStream(int columnIndex, InputStream xh) throws SQLException {
+	public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
 		throw newSQLFeatureNotSupportedException("updateAsciiStream");
 	}
 
@@ -3786,12 +3778,12 @@ public class MonetResultSet
 	}
 
 	@Override
-	public void updateSQLXML(String columnLabel, SQLXML x) throws SQLException {
+	public void updateSQLXML(int columnIndex, SQLXML x) throws SQLException {
 		throw newSQLFeatureNotSupportedException("updateSQLXML");
 	}
 
 	@Override
-	public void updateSQLXML(int columnIndex, SQLXML x) throws SQLException {
+	public void updateSQLXML(String columnLabel, SQLXML x) throws SQLException {
 		throw newSQLFeatureNotSupportedException("updateSQLXML");
 	}
 
@@ -3880,17 +3872,5 @@ public class MonetResultSet
 	private static final SQLDataException newSQLNumberFormatException(NumberFormatException error) {
 		return new SQLDataException("Could not convert value to a number. " + error.getMessage(), "22003");
 	}
-
-	/**
-	 * Small helper method that formats the "Method ... not implemented" message
-	 * and creates a new SQLFeatureNotSupportedException object
-	 * whose SQLState is set to "0A000": feature not supported.
-	 *
-	 * @param name the method name
-	 * @return a new created SQLFeatureNotSupportedException object with SQLState 0A000
-	 */
-	private static final SQLFeatureNotSupportedException newSQLFeatureNotSupportedException(String name) {
-		return new SQLFeatureNotSupportedException("Method " + name + " not implemented", "0A000");
-	}
 }
 
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetWrapper.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetWrapper.java
@@ -9,6 +9,7 @@
 package nl.cwi.monetdb.jdbc;
 
 import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
 
 /**
  * A Wrapper class which provide the ability to retrieve the delegate instance
@@ -75,4 +76,16 @@ public class MonetWrapper implements jav
 		}
 		throw new SQLException("Cannot unwrap to interface: " + (iface != null ? iface.getName() : ""), "0A000");
 	}
+
+	/**
+	 * Small helper method that formats the "Method ... not implemented" message
+	 * and creates a new SQLFeatureNotSupportedException object
+	 * whose SQLState is set to "0A000": feature not supported.
+	 *
+	 * @param name the method name
+	 * @return a new created SQLFeatureNotSupportedException object with SQLState 0A000
+	 */
+	static final SQLFeatureNotSupportedException newSQLFeatureNotSupportedException(String name) {
+		return new SQLFeatureNotSupportedException("Method " + name + " not implemented", "0A000");
+	}
 }