changeset 625:b32999570f4d

executeUpdate(sql) and executeLargeUpdate(sql) expect a Statement, not a Query. Improved the text of the Exception msg.
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 20 Jan 2022 17:10:50 +0100 (2022-01-20)
parents 71bcc7af90be
children 06d69b82d409
files src/main/java/org/monetdb/jdbc/MonetStatement.java
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/org/monetdb/jdbc/MonetStatement.java
+++ b/src/main/java/org/monetdb/jdbc/MonetStatement.java
@@ -457,10 +457,9 @@ public class MonetStatement
 	}
 
 	/**
-	 * Executes the given SQL statement, which returns a single ResultSet
-	 * object.
+	 * Executes the given SQL query, which returns a single ResultSet object.
 	 *
-	 * @param sql an SQL statement to be sent to the database, typically a
+	 * @param sql an SQL query statement to be sent to the database, typically a
 	 *        static SQL SELECT statement
 	 * @return a ResultSet object that contains the data produced by the given
 	 *         query; never null
@@ -490,7 +489,7 @@ public class MonetStatement
 	@Override
 	public int executeUpdate(final String sql) throws SQLException {
 		if (execute(sql) != false)
-			throw new SQLException("Query produced a result set", "M1M17");
+			throw new SQLException("Statement produced a result set", "M1M17");
 
 		return getUpdateCount();
 	}
@@ -523,7 +522,7 @@ public class MonetStatement
 
 		/* MonetDB has no way to disable this, so just do the normal thing ;) */
 		if (execute(sql) != false)
-			throw new SQLException("Query produced a result set", "M1M17");
+			throw new SQLException("Statement produced a result set", "M1M17");
 
 		return getUpdateCount();
 	}
@@ -678,9 +677,6 @@ public class MonetStatement
 	 * columns. If the limit is exceeded, the excess data is silently
 	 * discarded.
 	 *
-	 * The MonetDB JDBC driver currently doesn't support limiting
-	 * fieldsizes, and hence always return 0 (unlimited).
-	 *
 	 * @return the current column size limit for columns storing
 	 *         character and binary values; zero means there is no limit
 	 * @see #setMaxFieldSize(int max)
@@ -1341,7 +1337,7 @@ public class MonetStatement
 	@Override
 	public long executeLargeUpdate(final String sql) throws SQLException {
 		if (execute(sql) != false)
-			throw new SQLException("Query produced a result set", "M1M17");
+			throw new SQLException("Statement produced a result set", "M1M17");
 
 		return getLargeUpdateCount();
 	}
@@ -1383,7 +1379,7 @@ public class MonetStatement
 
 		/* MonetDB has no way to disable this, so just do the normal thing ;) */
 		if (execute(sql) != false)
-			throw new SQLException("Query produced a result set", "M1M17");
+			throw new SQLException("Statement produced a result set", "M1M17");
 
 		return getLargeUpdateCount();
 	}