]> granicus.if.org Git - postgresql/commitdiff
On Mon, 3 Sep 2001 22:01:17 -0500, you wrote:
authorBruce Momjian <bruce@momjian.us>
Thu, 6 Sep 2001 18:26:37 +0000 (18:26 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 6 Sep 2001 18:26:37 +0000 (18:26 +0000)
>public boolean isWritable(int column) throws SQLException
>{
>        if (isReadOnly(column))
>                return true;
>        else
>                return false;
>}

The author probably intended:

    public boolean isWritable(int column) throws SQLException
    {
        return !isReadOnly(column);
    }

And if he would have coded it this way he wouldn't have made
this mistake :-)

>hence, isWritable() will always return false. this is something
>of a problem :)

Why exactly? In a way, true is just as incorrect as false, and
perhaps it should throw "not implemented". But I guess that
would be too non-backwardly-compatible.

>let me know if i can provide further information.

Will you submit a patch?

Regards,
Ren? Pijlman <rene@lab.applinet.nl>

src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java
src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java

index d9e09c01dd1f1b69fe10f7d2456eaeab1c6d8006..73575cbaca544a035d02039a84778a5ad22e8028 100644 (file)
@@ -419,10 +419,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
    */
   public boolean isWritable(int column) throws SQLException
   {
-    if (isReadOnly(column))
-      return true;
-    else
-      return false;
+    return !isReadOnly(column);
   }
   
   /**
index 5d878b149e43223149d685bc995878520a4cf885..d1db49c054bdc818a79209f4943a41f25df6a11a 100644 (file)
@@ -414,10 +414,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
    */
   public boolean isWritable(int column) throws SQLException
   {
-    if (isReadOnly(column))
-      return true;
-    else
-      return false;
+    return !isReadOnly(column);
   }
   
   /**