src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -22,10 +22,11 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 package javax.sql.rowset.serial;
 
+import java.net.URL;
 import java.sql.*;
 import java.util.Arrays;
 import java.util.Map;
 
 /**

@@ -764,11 +765,19 @@
      *         <code>null</code>
      * @throws SQLException if the read position is located at an invalid
      * position; or if there are no further values in the stream.
      */
     public java.net.URL readURL() throws SQLException {
-        throw new SQLException("Operation not supported");
+        URL attrib = (URL)getNextAttribute();
+
+        if (attrib == null) {
+            lastValueWasNull = true;
+            return null;
+        } else {
+            lastValueWasNull = false;
+            return attrib;
+        }
     }
 
     //---------------------------- JDBC 4.0 -------------------------
 
     /**

@@ -779,12 +788,18 @@
      * at the head of the stream; <code>null</code> if the value read is
      * SQL <code>NULL</code>
      * @exception SQLException if a database access error occurs
      */
      public NClob readNClob() throws SQLException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
+        NClob attrib = (NClob)getNextAttribute();
+        if (attrib == null) {
+            lastValueWasNull = true;
+            return null;
+        } else {
+            lastValueWasNull = false;
+            return attrib;
+        }    }
 
     /**
      * Reads the next attribute in the stream and returns it as a <code>String</code>
      * in the Java programming language. It is intended for use when
      * accessing  <code>NCHAR</code>,<code>NVARCHAR</code>

@@ -792,12 +807,19 @@
      *
      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
      * @exception SQLException if a database access error occurs
      */
     public String readNString() throws SQLException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
+        String attrib = (String)getNextAttribute();
+
+        if (attrib == null) {
+            lastValueWasNull = true;
+            return null;
+        } else {
+            lastValueWasNull = false;
+            return attrib;
+        }    }
 
     /**
      * Reads an SQL <code>XML</code> value from the stream and returns it as a
      * <code>SQLXML</code> object in the Java programming language.
      *

@@ -805,12 +827,18 @@
      * at the head of the stream; <code>null</code> if the value read is
      * SQL <code>NULL</code>
      * @exception SQLException if a database access error occurs
      */
     public SQLXML readSQLXML() throws SQLException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
+        SQLXML attrib = (SQLXML)getNextAttribute();
+        if (attrib == null) {
+            lastValueWasNull = true;
+            return null;
+        } else {
+            lastValueWasNull = false;
+            return attrib;
+        }    }
 
      /**
      * Reads an SQL <code>ROWID</code> value from the stream and returns it as a
      * <code>RowId</code> object in the Java programming language.
      *

@@ -818,10 +846,17 @@
      * at the head of the stream; <code>null</code> if the value read is
      * SQL <code>NULL</code>
      * @exception SQLException if a database access error occurs
      */
     public RowId readRowId() throws SQLException {
-        throw new UnsupportedOperationException("Operation not supported");
+        RowId attrib = (RowId)getNextAttribute();
+        if (attrib == null) {
+            lastValueWasNull = true;
+            return null;
+        } else {
+            lastValueWasNull = false;
+            return attrib;
+        }
     }
 
 
 }