src/share/classes/java/sql/SQLInput.java

Print this page


   1 /*
   2  * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 404      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
 405      * this method
 406      * @since 1.6
 407      */
 408     SQLXML readSQLXML() throws SQLException;
 409 
 410     /**
 411      * Reads an SQL <code>ROWID</code> value from the stream and returns it as a
 412      * <code>RowId</code> object in the Java programming language.
 413      *
 414      * @return a <code>RowId</code> object representing data of the SQL <code>ROWID</code> value
 415      * at the head of the stream; <code>null</code> if the value read is
 416      * SQL <code>NULL</code>
 417      * @exception SQLException if a database access error occurs
 418      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
 419      * this method
 420      * @since 1.6
 421      */
 422     RowId readRowId() throws SQLException;
 423 


































 424 }
   1 /*
   2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 404      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
 405      * this method
 406      * @since 1.6
 407      */
 408     SQLXML readSQLXML() throws SQLException;
 409 
 410     /**
 411      * Reads an SQL <code>ROWID</code> value from the stream and returns it as a
 412      * <code>RowId</code> object in the Java programming language.
 413      *
 414      * @return a <code>RowId</code> object representing data of the SQL <code>ROWID</code> value
 415      * at the head of the stream; <code>null</code> if the value read is
 416      * SQL <code>NULL</code>
 417      * @exception SQLException if a database access error occurs
 418      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
 419      * this method
 420      * @since 1.6
 421      */
 422     RowId readRowId() throws SQLException;
 423     
 424     //--------------------------JDBC 4.2 -----------------------------
 425  
 426     /**
 427      * Reads the next attribute in the stream and returns it as an
 428      * {@code Object} in the Java programming language. The
 429      * actual type of the object returned is determined by the specified
 430      * Java data type, and any customizations present in this
 431      * stream's type map.
 432      *
 433      * <P>A type map is registered with the stream by the JDBC driver before the
 434      * stream is passed to the application.
 435      *
 436      * <P>When the attribute at the head of the stream is an SQL {@code NULL}
 437      * the method returns {@code null}. If the attribute is an SQL
 438      * structured or distinct
 439      * type, it determines the SQL type of the attribute at the head of the stream.
 440      * If the stream's type map has an entry for that SQL type, the driver
 441      * constructs an object of the appropriate class and calls the method
 442      * {@code SQLData.readSQL} on that object, which reads additional data from the
 443      * stream, using the protocol described for that method.
 444      *<p>
 445      * The default implementation will throw {@code SQLFeatureNotSupportedException}
 446      *
 447      * @param type Class representing the Java data type to convert the attribute to.
 448      * @return the attribute at the head of the stream as an {@code Object} in the
 449      * Java programming language;{@code null} if the attribute is SQL {@code NULL}
 450      * @exception SQLException if a database access error occurs
 451      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
 452      * this method
 453      * @since 1.8
 454      */
 455     default <T> T readObject(Class<T> type) throws SQLException {
 456        throw new SQLFeatureNotSupportedException("readObject not implemented");
 457     }
 458 }