package org.okip.service.dbc.api;



/*
   Copyright (c) 2002 Massachusetts Institute of Technology

   This work, including any software, documents, or other related items
   (the "Work"), is being provided by the copyright holder(s) subject to
   the terms of the MIT OKI(TM) API Definition License. By obtaining,
   using and/or copying this Work, you agree that you have read,
   understand, and will comply with the following terms and conditions of
   the MIT OKI(TM) API Definition License:

   You may use, copy, and distribute unmodified versions of this Work for
   any purpose, without fee or royalty, provided that you include the
   following on ALL copies of the Work that you make or distribute:

    *  The full text of the MIT OKI(TM) API Definition License in a
       location viewable to users of the redistributed Work.

    *  Any pre-existing intellectual property disclaimers, notices, or
       terms and conditions. If none exist, a short notice similar to the
       following should be used within the body of any redistributed
       Work: "Copyright (c) 2002 Massachusetts Institute of Technology. All
       Rights Reserved."

   You may modify or create Derivatives of this Work only for your
   internal purposes. You shall not distribute or transfer any such
   Derivative of this Work to any location or any other third party. For
   purposes of this license, "Derivative" shall mean any derivative of
   the Work as defined in the United States Copyright Act of 1976, such
   as a translation or modification.

   THIS WORK PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE WORK
   OR THE USE OR OTHER DEALINGS IN THE WORK.

   The name and trademarks of copyright holder(s) and/or MIT may NOT be
   used in advertising or publicity pertaining to the Work without
   specific, written prior permission. Title to copyright in the Work and
   any associated documentation will at all times remain with the
   copyright holders.

*/

/*
 * $Source: /cvs/oki/tech/src/org/okip/service/dbc/api/RowSet.java,v $
 */

/**
 * The interface that adds support to the OKI DBC API for the
 * JavaBeansTM component model. A rowset, which can be used as a
 * JavaBeans component in a visual Bean development environment, can
 * be created and configured at design time and executed at run time.
 *
 * <p>
 * Licensed under the {@link org.okip.service.ApiLicense MIT OKI&#153; API Definition License}.
 *
 * @version $Name:  $ / $Revision: 1.7 $ / $Date: 2002/07/29 18:42:43 $
 */
public interface RowSet
extends ResultSet {

  /* methods which are in RowSet in 1.4 but not in this interface:
     addRowSetListener
     removeRowSetListener
     setAsciiStream
     setBinaryStream
     setCharacterStream
   */

  /**
   * Clears the parameters set for this RowSet object's command.
   *
   */
  void clearParameters()
  throws DbcException;

  /**
   * Fills this RowSet object with data.
   *
   */
  void execute()
  throws DbcException;

  /**
   * Retrieves this RowSet object's command property.
   *
   * @return String that is a valid SQL query.
   */
  String getCommand()
  throws DbcException;

  /**
   * Retrieves the logical name that identifies the
   * data source for this RowSet object.
   *
   * @return String
   */
  String getDataSourceName()
  throws DbcException;

  /**
   * Retrieves whether escape processing is enabled
   * for this RowSet object.
   *
   * @return boolean
   */
  boolean getEscapeProcessing()
  throws DbcException;

  /**
   * Retrieves the maximum number of bytes that may
   * be returned for certain column values.
   *
   * @return int
   */
  int getMaxFieldSize()
  throws DbcException;

  /**
   * Retrieves the maximum number of rows that this
   * RowSet object can contain.
   *
   * @return int
   */
  int getMaxRows()
  throws DbcException;

  /**
   * Retrieves the password used to create a database
   * connection.
   *
   * @return String
   */
  String getPassword()
  throws DbcException;

  /**
   * Retrieves the maximum number of seconds the driver
   * will wait for a statement to execute.
   *
   * @return int
   */
  int getQueryTimeout()
  throws DbcException;

  /**
   * Retrieves the transaction isolation level set for
   * this RowSet object.
   *
   * @return int
   */
  int getTransactionIsolation()
  throws DbcException;

  /**
   * Retrieves the Map object associated with this RowSet
   * object, which specifies the custom mapping of SQL
   * user-defined types, if any.
   *
   * @return java.util.Map
   */
  java.util.Map getTypeMap()
  throws DbcException;

  /**
   * Retrieves the url property this RowSet object will use
   * to create a connection if it uses the DriverManager
   * instead of a DataSource object to establish the
   * connection.
   *
   * @return String
   */
  String getUrl()
  throws DbcException;

  /**
   * Retrieves the username used to create a database
   * connection for this RowSet object.
   *
   * @return String
   */
  String getUsername()
  throws DbcException;

  /**
   * Retrieves whether this RowSet object is read-only.
   *
   * @return boolean
   */
  boolean isReadOnly()
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command with the given Array value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setArray(int parameterIndex, Array x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given java.math.BigDecimal
   * value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setBigDecimal(int parameterIndex, java.math.BigDecimal x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command with the given Blob value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setBlob(int parameterIndex, Blob x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given Java boolean value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setBoolean(int parameterIndex, boolean x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given Java byte value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setByte(int parameterIndex, byte x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given Java array of
   * byte values.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setBytes(int parameterIndex, byte[] x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command with the given Clob value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setClob(int parameterIndex, org.okip.service.dbc.api.Clob x)
  throws DbcException;

  /**
   * Sets this RowSet object's command property
   * to the given SQL query.
   *
   * @param cmd
   *
   */
  void setCommand(String cmd)
  throws DbcException;

  /**
   * Sets the concurrency of this RowSet object
   * to the given concurrency level.
   *
   * @param concurrency
   *
   */
  void setConcurrency(int concurrency)
  throws DbcException;

  /**
   * Sets the data source name property for this
   * RowSet object to the given String.
   *
   * @param name
   *
   */
  void setDataSourceName(String name)
  throws DbcException;

  /**
   * Sets the designated parameter in this
   * RowSet object's command to the given
   * java.sql.Date value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setDate(int parameterIndex, java.sql.Date x)
  throws DbcException;

  /**
   * Sets the designated parameter in this
   * RowSet object's command with the given
   * java.sql.Date and java.util.Calendar values.
   *
   * @param parameterIndex
   * @param x
   * @param cal
   *
   */
  void setDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal)
  throws DbcException;

  /**
   * Sets the designated parameter in this
   * RowSet object's command to the given Java
   * double value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setDouble(int parameterIndex, double x)
  throws DbcException;

  /**
   * Sets escape processing for this RowSet
   * object on or off.
   *
   * @param enable
   */
  void setEscapeProcessing(boolean enable)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given Java float value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setFloat(int parameterIndex, float x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given Java int value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setInt(int parameterIndex, int x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given Java long value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setLong(int parameterIndex, long x)
  throws DbcException;

  /**
   * Sets the maximum number of bytes that can be
   * returned for a column value to the given
   * number of bytes.
   *
   * @param max
   *
   */
  void setMaxFieldSize(int max)
  throws DbcException;

  /**
   * Sets the maximum number of rows that this RowSet
   * object can contain to the specified number.
   *
   * @param max
   *
   */
  void setMaxRows(int max)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's SQL command to SQL NULL.
   *
   * @param parameterIndex
   * @param sqlType
   *
   */
  void setNull(int parameterIndex, int sqlType)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's SQL command to SQL NULL.
   *
   *
   * @param paramIndex
   * @param sqlType
   * @param typeName
   *
   */
  void setNull(int paramIndex, int sqlType, String typeName)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command with a Java Object.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setObject(int parameterIndex, Object x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command with a Java Object.
   *
   * @param parameterIndex
   * @param x
   * @param targetSqlType
   *
   */
  void setObject(int parameterIndex, Object x, int targetSqlType)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command with the given Java Object.
   *
   * @param parameterIndex
   * @param x
   * @param targetSqlType
   * @param scale
   *
   */
  void setObject(int parameterIndex, Object x, int targetSqlType, int scale)
  throws DbcException;

  /**
   * Sets the database password for this RowSet
   * object to the given String.
   *
   * @param password
   */
  void setPassword(String password)
  throws DbcException;

  /**
   * Sets the maximum time the driver will wait
   * for a statement to execute to the given
   * number of seconds.
   *
   * @param seconds
   *
   */
  void setQueryTimeout(int seconds)
  throws DbcException;

  /**
   * Sets whether this RowSet object is read-only
   * to the given boolean.
   *
   *
   * @param value
   *
   */
  void setReadOnly(boolean value)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command with the given Ref value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setRef(int parameterIndex, java.sql.Ref x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given Java Short value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setShort(int parameterIndex, short x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given Java String value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setString(int parameterIndex, String x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given java.sql.Time value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setTime(int parameterIndex, java.sql.Time x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command with the given java.sql.Time
   * and java.util.Calendar values.
   *
   * @param parameterIndex
   * @param x
   * @param cal
   *
   */
  void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command to the given java.sql.Timestamp
   * value.
   *
   * @param parameterIndex
   * @param x
   *
   */
  void setTimestamp(int parameterIndex, java.sql.Timestamp x)
  throws DbcException;

  /**
   * Sets the designated parameter in this RowSet
   * object's command with the given java.sql.Timestamp
   * and java.util.Calendar values.
   *
   * @param parameterIndex
   * @param x
   * @param cal
   *
   */
  void setTimestamp(int parameterIndex, java.sql.Timestamp x,
                    java.util.Calendar cal)
  throws DbcException;

  /**
   * Sets the transaction isolation level for this
   * RowSet object.
   *
   * @param level
   *
   */
  void setTransactionIsolation(int level)
  throws DbcException;

  /**
   * Sets the type of this RowSet object to the
   * given type.
   *
   * @param type
   *
   */
  void setType(int type)
  throws DbcException;

  /**
   * Installs the given java.util.Map object
   * as the default type map for this RowSet
   * object.
   *
   * @param typeMap
   *
   */
  void setTypeMap(java.util.Map typeMap)
  throws DbcException;

  /**
   * Sets the URL this RowSet object will use
   * when it uses the DriverManager to
   * create a connection.
   *
   * @param url
   *
   */
  void setUrl(String url)
  throws DbcException;

  /**
   * Sets the username property for this RowSet
   * object to the given String.
   *
   * @param name
   *
   */
  void setUsername(String name)
  throws DbcException;

}
