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

Print this page


   1 /*
   2  * Copyright (c) 2003, 2012, 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


 559     }
 560 
 561     /**
 562      * Writes an <code>java.sql.Type.DATALINK</code> object in the Java
 563      * programming language to this <code>SQLOutputImpl</code> object. The
 564      * driver converts this value to a serializable <code>SerialDatalink</code>
 565      * SQL <code>DATALINK</code> value before return it to the database.
 566      *
 567      * @param url an object representing a SQL <code>DATALINK</code> value
 568      * @throws SQLException if the <code>SQLOutputImpl</code> object is in
 569      *        use by a <code>SQLData</code> object attempting to write the attribute
 570      *        values of a UDT to the database.
 571      */
 572     @SuppressWarnings("unchecked")
 573     public void writeURL(java.net.URL url) throws SQLException {
 574         if (url == null) {
 575             attribs.add(null);
 576         } else {
 577             attribs.add(new SerialDatalink(url));
 578         }

 579     }
 580 
 581 
 582     /**
 583    * Writes the next attribute to the stream as a <code>String</code>
 584    * in the Java programming language. The driver converts this to a
 585    * SQL <code>NCHAR</code> or
 586    * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
 587    * (depending on the argument's
 588    * size relative to the driver's limits on <code>NVARCHAR</code> values)
 589    * when it sends it to the stream.
 590    *
 591    * @param x the value to pass to the database
 592    * @exception SQLException if a database access error occurs
 593    * @since 1.6
 594    */
 595    @SuppressWarnings("unchecked")
 596    public void writeNString(String x) throws SQLException {
 597         throw new UnsupportedOperationException("Operation not supported");
 598     }
 599 
 600   /**
 601    * Writes an SQL <code>NCLOB</code> value to the stream.
 602    *
 603    * @param x a <code>NClob</code> object representing data of an SQL
 604    * <code>NCLOB</code> value
 605    *
 606    * @exception SQLException if a database access error occurs
 607    * @since 1.6
 608    */
 609    @SuppressWarnings("unchecked")
 610    public void writeNClob(NClob x) throws SQLException {
 611         throw new UnsupportedOperationException("Operation not supported");
 612     }
 613 
 614 
 615   /**
 616    * Writes an SQL <code>ROWID</code> value to the stream.
 617    *
 618    * @param x a <code>RowId</code> object representing data of an SQL
 619    * <code>ROWID</code> value
 620    *
 621    * @exception SQLException if a database access error occurs
 622    * @since 1.6
 623    */
 624    @SuppressWarnings("unchecked")
 625    public void writeRowId(RowId x) throws SQLException {
 626         throw new UnsupportedOperationException("Operation not supported");
 627     }
 628 
 629 
 630   /**
 631    * Writes an SQL <code>XML</code> value to the stream.
 632    *
 633    * @param x a <code>SQLXML</code> object representing data of an SQL
 634    * <code>XML</code> value
 635    *
 636    * @exception SQLException if a database access error occurs
 637    * @since 1.6
 638    */
 639    @SuppressWarnings("unchecked")
 640    public void writeSQLXML(SQLXML x) throws SQLException {
 641         throw new UnsupportedOperationException("Operation not supported");
 642     }
 643 
 644 }
   1 /*
   2  * Copyright (c) 2003, 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


 559     }
 560 
 561     /**
 562      * Writes an <code>java.sql.Type.DATALINK</code> object in the Java
 563      * programming language to this <code>SQLOutputImpl</code> object. The
 564      * driver converts this value to a serializable <code>SerialDatalink</code>
 565      * SQL <code>DATALINK</code> value before return it to the database.
 566      *
 567      * @param url an object representing a SQL <code>DATALINK</code> value
 568      * @throws SQLException if the <code>SQLOutputImpl</code> object is in
 569      *        use by a <code>SQLData</code> object attempting to write the attribute
 570      *        values of a UDT to the database.
 571      */
 572     @SuppressWarnings("unchecked")
 573     public void writeURL(java.net.URL url) throws SQLException {
 574         if (url == null) {
 575             attribs.add(null);
 576         } else {
 577             attribs.add(new SerialDatalink(url));
 578         }
 579 
 580     }
 581 
 582 
 583   /**
 584    * Writes the next attribute to the stream as a <code>String</code>
 585    * in the Java programming language. The driver converts this to a
 586    * SQL <code>NCHAR</code> or
 587    * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
 588    * (depending on the argument's
 589    * size relative to the driver's limits on <code>NVARCHAR</code> values)
 590    * when it sends it to the stream.
 591    *
 592    * @param x the value to pass to the database
 593    * @exception SQLException if a database access error occurs
 594    * @since 1.6
 595    */
 596    @SuppressWarnings("unchecked")
 597    public void writeNString(String x) throws SQLException {
 598        attribs.add(x);
 599    }
 600 
 601   /**
 602    * Writes an SQL <code>NCLOB</code> value to the stream.
 603    *
 604    * @param x a <code>NClob</code> object representing data of an SQL
 605    * <code>NCLOB</code> value
 606    *
 607    * @exception SQLException if a database access error occurs
 608    * @since 1.6
 609    */
 610    @SuppressWarnings("unchecked")
 611    public void writeNClob(NClob x) throws SQLException {
 612            attribs.add(x);
 613     }
 614 
 615 
 616   /**
 617    * Writes an SQL <code>ROWID</code> value to the stream.
 618    *
 619    * @param x a <code>RowId</code> object representing data of an SQL
 620    * <code>ROWID</code> value
 621    *
 622    * @exception SQLException if a database access error occurs
 623    * @since 1.6
 624    */
 625    @SuppressWarnings("unchecked")
 626    public void writeRowId(RowId x) throws SQLException {
 627         attribs.add(x);
 628    }
 629 
 630 
 631   /**
 632    * Writes an SQL <code>XML</code> value to the stream.
 633    *
 634    * @param x a <code>SQLXML</code> object representing data of an SQL
 635    * <code>XML</code> value
 636    *
 637    * @exception SQLException if a database access error occurs
 638    * @since 1.6
 639    */
 640    @SuppressWarnings("unchecked")
 641    public void writeSQLXML(SQLXML x) throws SQLException {
 642         attribs.add(x);
 643     }
 644 
 645 }