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/ParameterMetaData.java,v $
 */

/**
 * An object that can be used to get information about the types and
 * properties of the parameters in a PreparedStatement object.
 *
 * <p>
 * Licensed under the {@link org.okip.service.ApiLicense MIT OKI&#153; API Definition License}.
 *
 * @version $Name:  $ / $Revision: 1.6 $ / $Date: 2002/07/29 18:42:43 $
 */
public interface ParameterMetaData
extends java.io.Serializable {

  /**
   The constant indicating that the parameter's mode is IN.
   */
  public static final int parameterModeIn = 0;

  /**
   The constant indicating that the parameter's mode is INOUT.
   */
  public static final int parameterModeInOut = 1;

  /**
   The constant indicating that the parameter's mode is OUT.
   */
  public static final int parameterModeOut = 2;

  /**
   The constant indicating that the mode of the parameter is unknown.
   */
  public static final int parameterModeUnknown = 3;

  /**
   The constant indicating that a parameter will not allow NULL values.
   */
  public static final int parameterNoNulls = 4;

  /**
   The constant indicating that a parameter will allow NULL values.
   */
  public static final int parameterNullable = 5;

  /**
   The constant indicating that the nullability of a parameter is unknown.
   */
  public static final int parameterNullableUnknown = 6;

  /**
   * Retrieves the fully-qualified name
   * of the Java class whose instances
   * should be passed to the method
   * PreparedStatement.setObject.
   *
   * @param param
   *
   * @return String
   *
   * @throws DbcException
   *
   */
  String getParameterClassName(int param)
  throws DbcException;

  /**
   * Retrieves the number of parameters
   * in the PreparedStatement object for
   * which this ParameterMetaData object
   * contains information.
   *
   * @return int
   *
   * @throws DbcException
   *
   */
  int getParameterCount()
  throws DbcException;

  /**
   * Retrieves the designated parameter's mode.
   *
   *
   * @param param
   * @return param
   *
   *
   * @throws DbcException
   *
   */
  int getParameterMode(int param)
  throws DbcException;

  /**
   * Retrieves the designated parameter's SQL type.
   *
   *
   * @param param
   * @return param
   *
   *
   * @throws DbcException
   *
   */
  int getParameterType(int param)
  throws DbcException;

  /**
   * Retrieves the designated parameter's
   * database-specific type name.
   *
   *
   * @param param
   * @return param
   *
   *
   * @throws DbcException
   *
   */
  String getParameterTypeName(int param)
  throws DbcException;

  /**
   * Retrieves the designated parameter's
   * number of decimal digits.
   *
   *
   * @param param
   * @return param
   *
   *
   * @throws DbcException
   *
   */
  int getPrecision(int param)
  throws DbcException;

  /**
   * Retrieves the designated parameter's
   * number of digits to right of the
   * decimal point.
   *
   *
   * @param param
   * @return param
   *
   *
   * @throws DbcException
   *
   */
  int getScale(int param)
  throws DbcException;

  /**
   * Retrieves whether null values are
   * allowed in the designated parameter.
   *
   *
   * @param param
   * @return param
   *
   *
   * @throws DbcException
   *
   */
  int isNullable(int param)
  throws DbcException;

  /**
   * Retrieves whether values for the
   * designated parameter can be signed
   * numbers.
   *
   *
   * @param param
   * @return param
   *
   *
   * @throws DbcException
   *
   */
  boolean isSigned(int param)
  throws DbcException;

}
