Changeset: 9a026aa272bb for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=9a026aa272bb
Modified Files:
        src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
Branch: default
Log Message:

Comply with the JDBC spec by using argument name: parameterIndex
instead of paramIndex or index or i.


diffs (truncated from 503 to 300 lines):

diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java 
b/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
@@ -945,12 +945,12 @@ public class MonetPreparedStatement
         * driver converts this to an SQL ARRAY value when it sends it to
         * the database.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @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
         */
        @Override
-       public void setArray(int i, Array x) throws SQLException {
+       public void setArray(int parameterIndex, Array x) throws SQLException {
                throw newSQLFeatureNotSupportedException("setArray");
        }
 
@@ -1032,14 +1032,14 @@ public class MonetPreparedStatement
         * The driver converts this to an SQL NUMERIC value when it sends it to 
the
         * database.
         *
-        * @param idx the first parameter is 1, the second is 2, ...
+        * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param x the parameter value
         * @throws SQLException if a database access error occurs
         */
        @Override
-       public void setBigDecimal(int idx, BigDecimal x) throws SQLException {
+       public void setBigDecimal(int parameterIndex, BigDecimal x) throws 
SQLException {
                // get array position
-               int i = getParamIdx(idx);
+               int i = getParamIdx(parameterIndex);
 
                // round to the scale of the DB:
                x = x.setScale(scale[i], RoundingMode.HALF_UP);
@@ -1059,7 +1059,7 @@ public class MonetPreparedStatement
                        xStr = xStr.substring(0, Math.min(xStr.length(), dot + 
1 + scale[i]));
                while (xStr.startsWith("0") && xStr.length() > 1)
                        xStr = xStr.substring(1);
-               setValue(idx, xStr);
+               setValue(parameterIndex, xStr);
        }
 
        /**
@@ -1137,14 +1137,14 @@ public class MonetPreparedStatement
         * Sets the designated parameter to the given Blob object. The driver
         * converts this to an SQL BLOB value when it sends it to the database.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param x a Blob object that maps an SQL BLOB value
         * @throws SQLException if a database access error occurs
         * @throws SQLFeatureNotSupportedException the JDBC driver does
         *         not support this method
         */
        @Override
-       public void setBlob(int i, InputStream x) throws SQLException {
+       public void setBlob(int parameterIndex, InputStream x) throws 
SQLException {
                throw newSQLFeatureNotSupportedException("setBlob");
        }
 
@@ -1152,14 +1152,14 @@ public class MonetPreparedStatement
         * Sets the designated parameter to the given Blob object. The driver
         * converts this to an SQL BLOB value when it sends it to the database.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param x a Blob object that maps an SQL BLOB value
         * @throws SQLException if a database access error occurs
         * @throws SQLFeatureNotSupportedException the JDBC driver does
         *         not support this method
         */
        @Override
-       public void setBlob(int i, Blob x) throws SQLException {
+       public void setBlob(int parameterIndex, Blob x) throws SQLException {
                throw newSQLFeatureNotSupportedException("setBlob");
        }
 
@@ -1174,7 +1174,7 @@ public class MonetPreparedStatement
         * may have to do extra work to determine whether the parameter data
         * should be sent to the server as a LONGVARBINARY or a BLOB.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param is an object that contains the data to set the parameter
         *           value to
         * @param length the number of bytes in the parameter data
@@ -1183,7 +1183,7 @@ public class MonetPreparedStatement
         *         not support this method
         */
        @Override
-       public void setBlob(int i, InputStream is, long length) throws 
SQLException {
+       public void setBlob(int parameterIndex, InputStream is, long length) 
throws SQLException {
                throw newSQLFeatureNotSupportedException("setBlob");
        }
 
@@ -1334,28 +1334,28 @@ public class MonetPreparedStatement
         * Sets the designated parameter to the given Clob object. The driver
         * converts this to an SQL CLOB value when it sends it to the database.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param x a Clob object that maps an SQL CLOB value
         * @throws SQLException if a database access error occurs
         */
        @Override
-       public void setClob(int i, Clob x) throws SQLException {
+       public void setClob(int parameterIndex, Clob x) throws SQLException {
                if (x == null) {
-                       setNull(i, -1);
+                       setNull(parameterIndex, -1);
                        return;
                }
 
                // simply serialise the CLOB into a variable for now... far from
                // efficient, but might work for a few cases...
                // be on your marks: we have to cast the length down!
-               setString(i, x.getSubString(1L, (int)(x.length())));
+               setString(parameterIndex, x.getSubString(1L, 
(int)(x.length())));
        }
 
        /**
         * Sets the designated parameter to the given Clob object. The driver
         * converts this to an SQL CLOB value when it sends it to the database.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param reader an object that contains the data to set the parameter
         *          value to
         * @throws SQLException if a database access error occurs
@@ -1363,9 +1363,9 @@ public class MonetPreparedStatement
         *         not support this method
         */
        @Override
-       public void setClob(int i, Reader reader) throws SQLException {
+       public void setClob(int parameterIndex, Reader reader) throws 
SQLException {
                if (reader == null) {
-                       setNull(i, -1);
+                       setNull(parameterIndex, -1);
                        return;
                }
                // Some buffer. Size of 8192 is default for BufferedReader, 
so...
@@ -1376,7 +1376,7 @@ public class MonetPreparedStatement
                        while ((numChars = reader.read(arr, 0, arr.length)) > 
0) {
                                buf.append(arr, 0, numChars);
                        }
-                       setString(i, buf.toString());
+                       setString(parameterIndex, buf.toString());
                } catch (IOException e) {
                        throw new SQLException(e);
                }
@@ -1393,16 +1393,16 @@ public class MonetPreparedStatement
         * extra work to determine whether the parameter data should be sent
         * to the server as a LONGVARCHAR or a CLOB.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param reader An object that contains the data to set the
         *        parameter value to.
         * @param length the number of characters in the parameter data.
         * @throws SQLException if a database access error occurs
         */
        @Override
-       public void setClob(int i, Reader reader, long length) throws 
SQLException {
+       public void setClob(int parameterIndex, Reader reader, long length) 
throws SQLException {
                if (reader == null || length < 0) {
-                       setNull(i, -1);
+                       setNull(parameterIndex, -1);
                        return;
                }
                // simply serialise the CLOB into a variable for now... far from
@@ -1416,7 +1416,7 @@ public class MonetPreparedStatement
                }
                // We have to rewind the buffer, because otherwise toString() 
returns "".
                buf.rewind();
-               setString(i, buf.toString());
+               setString(parameterIndex, buf.toString());
        }
 
        /**
@@ -1524,14 +1524,14 @@ public class MonetPreparedStatement
         * necessary conversion from Java character format to the national
         * character set in the database.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @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 i, Reader value) throws 
SQLException {
+       public void setNCharacterStream(int parameterIndex, Reader value) 
throws SQLException {
                throw newSQLFeatureNotSupportedException("setNCharacterStream");
        }
 
@@ -1541,7 +1541,7 @@ public class MonetPreparedStatement
         * necessary conversion from Java character format to the national
         * character set in the database.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param value the parameter value
         * @param length the number of characters in the parameter data.
         * @throws SQLException if a database access error occurs
@@ -1549,7 +1549,7 @@ public class MonetPreparedStatement
         *         not support this method
         */
        @Override
-       public void setNCharacterStream(int i, Reader value, long length)
+       public void setNCharacterStream(int parameterIndex, Reader value, long 
length)
                throws SQLException
        {
                throw newSQLFeatureNotSupportedException("setNCharacterStream");
@@ -1560,14 +1560,14 @@ public class MonetPreparedStatement
         * driver converts this to a SQL NCLOB value when it sends it to the
         * database.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @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 setNClob(int i, Reader value) throws SQLException {
+       public void setNClob(int parameterIndex, Reader value) throws 
SQLException {
                throw newSQLFeatureNotSupportedException("setNClob");
        }
 
@@ -1576,14 +1576,14 @@ public class MonetPreparedStatement
         * driver converts this to a SQL NCLOB value when it sends it to the
         * database.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @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 setNClob(int i, NClob value) throws SQLException {
+       public void setNClob(int parameterIndex, NClob value) throws 
SQLException {
                throw newSQLFeatureNotSupportedException("setNClob");
        }
 
@@ -1598,7 +1598,7 @@ public class MonetPreparedStatement
         * extra work to determine whether the parameter data should be sent
         * to the server as a LONGNVARCHAR or a NCLOB.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param r An object that contains the data to set the parameter
         *          value to
         * @param length the number of characters in the parameter data
@@ -1607,7 +1607,7 @@ public class MonetPreparedStatement
         *         not support this method
         */
        @Override
-       public void setNClob(int i, Reader r, long length) throws SQLException {
+       public void setNClob(int parameterIndex, Reader r, long length) throws 
SQLException {
                throw newSQLFeatureNotSupportedException("setNClob");
        }
 
@@ -1617,14 +1617,14 @@ public class MonetPreparedStatement
         * value (depending on the argument's size relative to the driver's
         * limits on NVARCHAR values) when it sends it to the database.
         *
-        * @param i the first parameter is 1, the second is 2, ...
+        * @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 i, String value) throws SQLException {
+       public void setNString(int parameterIndex, String value) throws 
SQLException {
                throw newSQLFeatureNotSupportedException("setNString");
        }
 
@@ -1660,7 +1660,7 @@ public class MonetPreparedStatement
         * parameter of any JDBC type. If the parameter does not have a
         * user-defined or REF type, the given typeName is ignored.
         *
-        * @param paramIndex the first parameter is 1, the second is 2, ...
+        * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param sqlType a value from java.sql.Types
         * @param typeName the fully-qualified name of an SQL user-defined type;
         *                 ignored if the parameter is not a user-defined type 
or
@@ -1668,11 +1668,11 @@ public class MonetPreparedStatement
         * @throws SQLException if a database access error occurs
         */
        @Override
-       public void setNull(int paramIndex, int sqlType, String typeName)
+       public void setNull(int parameterIndex, int sqlType, String typeName)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to