0N/A/*
2362N/A * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.sql;
0N/A
0N/A/**
0N/A *
0N/A * The representation (mapping) in the Java programming language of an SQL ROWID
0N/A * value. An SQL ROWID is a built-in type, a value of which can be thought of as
0N/A * an address for its identified row in a database table. Whether that address
0N/A * is logical or, in any respects, physical is determined by its originating data
0N/A * source.
0N/A * <p>
0N/A * Methods in the interfaces <code>ResultSet</code>, <code>CallableStatement</code>,
0N/A * and <code>PreparedStatement</code>, such as <code>getRowId</code> and <code>setRowId</code>
0N/A * allow a programmer to access a SQL <code>ROWID</code> value. The <code>RowId</code>
0N/A * interface provides a method
0N/A * for representing the value of the <code>ROWID</code> as a byte array or as a
0N/A * <code>String</code>.
0N/A * <p>
0N/A * The method <code>getRowIdLifetime</code> in the interface <code>DatabaseMetaData</code>,
0N/A * can be used
0N/A * to determine if a <code>RowId</code> object remains valid for the duration of the transaction in
0N/A * which the <code>RowId</code> was created, the duration of the session in which
0N/A * the <code>RowId</code> was created,
0N/A * or, effectively, for as long as its identified row is not deleted. In addition
0N/A * to specifying the duration of its valid lifetime outside its originating data
0N/A * source, <code>getRowIdLifetime</code> specifies the duration of a <code>ROWID</code>
0N/A * value's valid lifetime
0N/A * within its originating data source. In this, it differs from a large object,
0N/A * because there is no limit on the valid lifetime of a large object within its
0N/A * originating data source.
0N/A * <p>
0N/A * All methods on the <code>RowId</code> interface must be fully implemented if the
0N/A * JDBC driver supports the data type.
0N/A *
0N/A * @see java.sql.DatabaseMetaData
0N/A * @since 1.6
0N/A */
0N/A
0N/Apublic interface RowId {
0N/A /**
0N/A * Compares this <code>RowId</code> to the specified object. The result is
0N/A * <code>true</code> if and only if the argument is not null and is a RowId
0N/A * object that represents the same ROWID as this object.
0N/A * <p>
0N/A * It is important
0N/A * to consider both the origin and the valid lifetime of a <code>RowId</code>
0N/A * when comparing it to another <code>RowId</code>. If both are valid, and
0N/A * both are from the same table on the same data source, then if they are equal
0N/A * they identify
0N/A * the same row; if one or more is no longer guaranteed to be valid, or if
0N/A * they originate from different data sources, or different tables on the
0N/A * same data source, they may be equal but still
0N/A * not identify the same row.
0N/A *
0N/A * @param obj the <code>Object</code> to compare this <code>RowId</code> object
0N/A * against.
0N/A * @return true if the <code>RowId</code>s are equal; false otherwise
0N/A * @since 1.6
0N/A */
0N/A boolean equals(Object obj);
0N/A
0N/A /**
0N/A * Returns an array of bytes representing the value of the SQL <code>ROWID</code>
0N/A * designated by this <code>java.sql.RowId</code> object.
0N/A *
0N/A * @return an array of bytes, whose length is determined by the driver supplying
0N/A * the connection, representing the value of the ROWID designated by this
0N/A * java.sql.RowId object.
0N/A */
0N/A byte[] getBytes();
0N/A
0N/A /**
0N/A * Returns a String representing the value of the SQL ROWID designated by this
0N/A * <code>java.sql.RowId</code> object.
0N/A * <p>
0N/A *Like <code>java.sql.Date.toString()</code>
0N/A * returns the contents of its DATE as the <code>String</code> "2004-03-17"
0N/A * rather than as DATE literal in SQL (which would have been the <code>String</code>
0N/A * DATE "2004-03-17"), toString()
0N/A * returns the contents of its ROWID in a form specific to the driver supplying
0N/A * the connection, and possibly not as a <code>ROWID</code> literal.
0N/A *
0N/A * @return a String whose format is determined by the driver supplying the
0N/A * connection, representing the value of the <code>ROWID</code> designated
0N/A * by this <code>java.sql.RowId</code> object.
0N/A */
0N/A String toString();
0N/A
0N/A /**
0N/A * Returns a hash code value of this <code>RowId</code> object.
0N/A *
0N/A * @return a hash code for the <code>RowId</code>
0N/A */
0N/A int hashCode();
0N/A
0N/A}