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

Update implementation to match the JDBC spec so use
parameters columnIndex instead of i and columnLabel instead of colName or 
columnName.


diffs (truncated from 1101 to 300 lines):

diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java 
b/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetResultSet.java
@@ -325,25 +325,25 @@ public class MonetResultSet extends Mone
         * list contains the same column more than once, the first instance of 
the
         * column will be returned.
         *
-        * @param columnName the name of the column
+        * @param columnLabel the name of the column
         * @return the column index of the given column name
-        * @throws SQLException if the ResultSet object does not contain 
columnName
+        * @throws SQLException if the ResultSet object does not contain 
columnLabel
         */
        @Override
-       public int findColumn(String columnName) throws SQLException {
-               if (columnName != null) {
+       public int findColumn(String columnLabel) throws SQLException {
+               if (columnLabel != null) {
                        final int array_size = columns.length;
                        for (int i = 0; i < array_size; i++) {
-                               if (columnName.equals(columns[i]))
+                               if (columnLabel.equals(columns[i]))
                                        return i + 1;
                        }
                        /* if an exact match did not succeed try a case 
insensitive match */
                        for (int i = 0; i < array_size; i++) {
-                               if (columnName.equalsIgnoreCase(columns[i]))
+                               if (columnLabel.equalsIgnoreCase(columns[i]))
                                        return i + 1;
                        }
                }
-               throw new SQLException("No such column name: " + columnName, 
"M1M05");
+               throw new SQLException("No such column name: " + columnLabel, 
"M1M05");
        }
 
        /**
@@ -364,7 +364,7 @@ public class MonetResultSet extends Mone
                throw newSQLFeatureNotSupportedException("getArray");
        }
        @Override
-       public Array getArray(String colName) throws SQLException {
+       public Array getArray(String columnLabel) throws SQLException {
                throw newSQLFeatureNotSupportedException("getArray");
        }
 
@@ -374,7 +374,7 @@ public class MonetResultSet extends Mone
                throw newSQLFeatureNotSupportedException("getAsciiStream");
        }
        @Override
-       public InputStream getAsciiStream(String columnName) throws 
SQLException {
+       public InputStream getAsciiStream(String columnLabel) throws 
SQLException {
                throw newSQLFeatureNotSupportedException("getAsciiStream");
        }
 
@@ -385,7 +385,7 @@ public class MonetResultSet extends Mone
        }
        @Override
        @Deprecated
-       public InputStream getUnicodeStream(String columnName) throws 
SQLException {
+       public InputStream getUnicodeStream(String columnLabel) throws 
SQLException {
                throw newSQLFeatureNotSupportedException("getUnicodeStream");
        }
 
@@ -444,7 +444,7 @@ public class MonetResultSet extends Mone
         * when the method available  is called whether there is data
         * available or not.
         *
-        * @param columnName the label for the column specified with
+        * @param columnLabel the label for the column specified with
         * the SQL AS clause. If the SQL AS clause was not specified, then
         * the label is the name of the column
         * @return a Java input stream that delivers the database column
@@ -455,8 +455,8 @@ public class MonetResultSet extends Mone
         * result set
         */
        @Override
-       public InputStream getBinaryStream(String columnName) throws 
SQLException {
-               return getBinaryStream(findColumn(columnName));
+       public InputStream getBinaryStream(String columnLabel) throws 
SQLException {
+               return getBinaryStream(findColumn(columnLabel));
        }
 
        /**
@@ -488,15 +488,15 @@ public class MonetResultSet extends Mone
         * Retrieves the value of the designated column in the current row
         * of this ResultSet object as a java.io.Reader object.
         *
-        * @param columnName the name of the column
+        * @param columnLabel the name of the column
         * @return a java.io.Reader object that contains the column value;
         *         if the value is SQL NULL, the value returned is null in
         *         the Java programming language.
         * @throws SQLException if a database access error occurs
         */
        @Override
-       public Reader getCharacterStream(String columnName) throws SQLException 
{
-               return getCharacterStream(findColumn(columnName));
+       public Reader getCharacterStream(String columnLabel) throws 
SQLException {
+               return getCharacterStream(findColumn(columnLabel));
        }
 
        /**
@@ -524,7 +524,7 @@ public class MonetResultSet extends Mone
         * intended for use when accessing NCHAR,NVARCHAR and LONGNVARCHAR
         * columns.
         *
-        * @param columnName the name of the column
+        * @param columnLabel the name of the column
         * @return a java.io.Reader object that contains the column value;
         *         if the value is SQL NULL, the value returned is null in
         *         the Java programming language.
@@ -533,7 +533,7 @@ public class MonetResultSet extends Mone
         *         not support this method
         */
        @Override
-       public Reader getNCharacterStream(String columnName) throws 
SQLException {
+       public Reader getNCharacterStream(String columnLabel) throws 
SQLException {
                throw newSQLFeatureNotSupportedException("getNCharacterStream");
        }
 
@@ -542,7 +542,7 @@ public class MonetResultSet extends Mone
         * of this ResultSet object as a Blob object in the Java programming
         * language.
         *
-        * @param i the first column is 1, the second is 2, ...
+        * @param columnIndex the first column is 1, the second is 2, ...
         * @return a Blob object representing the SQL BLOB value in the
         *         specified column
         * @throws SQLException if a database access error occurs
@@ -567,15 +567,15 @@ public class MonetResultSet extends Mone
         * of this ResultSet object as a Blob object in the Java programming
         * language.
         *
-        * @param colName the name of the column from which to retrieve
+        * @param columnLabel the name of the column from which to retrieve
         *        the value
         * @return a Blob object representing the SQL BLOB value in the
         *         specified column
         * @throws SQLException if a database access error occurs
         */
        @Override
-       public Blob getBlob(String colName) throws SQLException {
-               return getBlob(findColumn(colName));
+       public Blob getBlob(String columnLabel) throws SQLException {
+               return getBlob(findColumn(columnLabel));
        }
 
        /**
@@ -583,7 +583,7 @@ public class MonetResultSet extends Mone
         * of this ResultSet object as a Clob object in the
         * Java programming language.
         *
-        * @param i the first column is 1, the second is 2, ...
+        * @param columnIndex the first column is 1, the second is 2, ...
         * @return a Clob object representing the SQL CLOB value in the
         *         specified column
         * @throws SQLException if a database access error occurs
@@ -608,15 +608,15 @@ public class MonetResultSet extends Mone
         * of this ResultSet object as a Clob object in the
         * Java programming language.
         *
-        * @param colName the name of the column from which to retrieve
+        * @param columnLabel the name of the column from which to retrieve
         *        the value
         * @return a Clob object representing the SQL CLOB value in the
         *         specified column
         * @throws SQLException if a database access error occurs
         */
        @Override
-       public Clob getClob(String colName) throws SQLException {
-               return getClob(findColumn(colName));
+       public Clob getClob(String columnLabel) throws SQLException {
+               return getClob(findColumn(columnLabel));
        }
 
        /**
@@ -624,7 +624,7 @@ public class MonetResultSet extends Mone
         * of this ResultSet object as a NClob object in the
         * Java programming language.
         *
-        * @param i the first column is 1, the second is 2, ...
+        * @param columnIndex the first column is 1, the second is 2, ...
         * @return a NClob object representing the SQL NCLOB value in the
         *         specified column
         * @throws SQLException if a database access error occurs
@@ -632,7 +632,7 @@ public class MonetResultSet extends Mone
         *         not support this method
         */
        @Override
-       public NClob getNClob(int i) throws SQLException {
+       public NClob getNClob(int columnIndex) throws SQLException {
                throw newSQLFeatureNotSupportedException("getNClob");
        }
 
@@ -641,7 +641,7 @@ public class MonetResultSet extends Mone
         * of this ResultSet object as a NClob object in the
         * Java programming language.
         *
-        * @param colName the name of the column from which to retrieve
+        * @param columnLabel the name of the column from which to retrieve
         *        the value
         * @return a NClob object representing the SQL NCLOB value in the
         *         specified column
@@ -650,7 +650,7 @@ public class MonetResultSet extends Mone
         *         not support this method
         */
        @Override
-       public NClob getNClob(String colName) throws SQLException {
+       public NClob getNClob(String columnLabel) throws SQLException {
                throw newSQLFeatureNotSupportedException("getNClob");
        }
 
@@ -717,21 +717,21 @@ public class MonetResultSet extends Mone
         * Retrieves the value of the designated column in the current row of 
this
         * ResultSet object as a java.math.BigDecimal with full precision.
         *
-        * @param columnName the SQL name of the column
+        * @param columnLabel the SQL name of the column
         * @return the column value (full precision); if the value is SQL NULL,
         *         the value returned is null in the Java programming language.
         * @throws SQLException if a database access error occurs
         */
        @Override
-       public BigDecimal getBigDecimal(String columnName) throws SQLException {
-               return getBigDecimal(findColumn(columnName));
+       public BigDecimal getBigDecimal(String columnLabel) throws SQLException 
{
+               return getBigDecimal(findColumn(columnLabel));
        }
 
        /**
         * Retrieves the value of the designated column in the current row of 
this
         * ResultSet object as a java.math.BigDecimal with full precision.
         *
-        * @param columnName the SQL name of the column
+        * @param columnLabel the SQL name of the column
         * @param scale the number of digits to the right of the decimal point
         * @return the column value (full precision); if the value is SQL NULL,
         *         the value returned is null in the Java programming language.
@@ -739,10 +739,10 @@ public class MonetResultSet extends Mone
         */
        @Override
        @Deprecated
-       public BigDecimal getBigDecimal(String columnName, int scale)
+       public BigDecimal getBigDecimal(String columnLabel, int scale)
                throws SQLException
        {
-               return getBigDecimal(findColumn(columnName), scale);
+               return getBigDecimal(findColumn(columnLabel), scale);
        }
 
        // See Sun JDBC Specification 3.0 Table B-6
@@ -818,14 +818,14 @@ public class MonetResultSet extends Mone
         * Retrieves the value of the designated column in the current row of 
this
         * ResultSet object as a boolean in the Java programming language.
         *
-        * @param columnName the SQL name of the column
+        * @param columnLabel the SQL name of the column
         * @return the column value; if the value is SQL NULL, the value 
returned
         *         is false
-        * @throws SQLException if the ResultSet object does not contain 
columnName
+        * @throws SQLException if the ResultSet object does not contain 
columnLabel
         */
        @Override
-       public boolean getBoolean(String columnName) throws SQLException {
-               return getBoolean(findColumn(columnName));
+       public boolean getBoolean(String columnLabel) throws SQLException {
+               return getBoolean(findColumn(columnLabel));
        }
 
        /**
@@ -858,14 +858,14 @@ public class MonetResultSet extends Mone
         * Retrieves the value of the designated column in the current row of 
this
         * ResultSet object as a byte in the Java programming language.
         *
-        * @param columnName the SQL name of the column
+        * @param columnLabel the SQL name of the column
         * @return the column value; if the value is SQL NULL, the value 
returned
         *         is 0
         * @throws SQLException if a database access error occurs
         */
        @Override
-       public byte getByte(String columnName) throws SQLException {
-               return getByte(findColumn(columnName));
+       public byte getByte(String columnLabel) throws SQLException {
+               return getByte(findColumn(columnLabel));
        }
 
        /**
@@ -923,14 +923,14 @@ public class MonetResultSet extends Mone
         *       an encoding into a sequence of bytes using the platform's 
default
         *       charset.
         *
-        * @param columnName the SQL name of the column
+        * @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 a database access error occurs
         */
        @Override
-       public byte[] getBytes(String columnName) throws SQLException {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to