0N/A/*
2362N/A * Copyright (c) 2000, 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 * An object that can be used to get information about the types
0N/A * and properties for each parameter marker in a
0N/A * <code>PreparedStatement</code> object. For some queries and driver
0N/A * implementations, the data that would be returned by a <code>ParameterMetaData</code>
0N/A * object may not be available until the <code>PreparedStatement</code> has
0N/A * been executed.
0N/A *<p>
0N/A *Some driver implementations may not be able to provide information about the
0N/A *types and properties for each parameter marker in a <code>CallableStatement</code>
0N/A *object.
0N/A *
0N/A * @since 1.4
0N/A */
0N/A
0N/Apublic interface ParameterMetaData extends Wrapper {
0N/A
0N/A /**
0N/A * Retrieves the number of parameters in the <code>PreparedStatement</code>
0N/A * object for which this <code>ParameterMetaData</code> object contains
0N/A * information.
0N/A *
0N/A * @return the number of parameters
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.4
0N/A */
0N/A int getParameterCount() throws SQLException;
0N/A
0N/A /**
0N/A * Retrieves whether null values are allowed in the designated parameter.
0N/A *
0N/A * @param param the first parameter is 1, the second is 2, ...
0N/A * @return the nullability status of the given parameter; one of
0N/A * <code>ParameterMetaData.parameterNoNulls</code>,
0N/A * <code>ParameterMetaData.parameterNullable</code>, or
0N/A * <code>ParameterMetaData.parameterNullableUnknown</code>
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.4
0N/A */
0N/A int isNullable(int param) throws SQLException;
0N/A
0N/A /**
0N/A * The constant indicating that a
0N/A * parameter will not allow <code>NULL</code> values.
0N/A */
0N/A int parameterNoNulls = 0;
0N/A
0N/A /**
0N/A * The constant indicating that a
0N/A * parameter will allow <code>NULL</code> values.
0N/A */
0N/A int parameterNullable = 1;
0N/A
0N/A /**
0N/A * The constant indicating that the
0N/A * nullability of a parameter is unknown.
0N/A */
0N/A int parameterNullableUnknown = 2;
0N/A
0N/A /**
0N/A * Retrieves whether values for the designated parameter can be signed numbers.
0N/A *
0N/A * @param param the first parameter is 1, the second is 2, ...
0N/A * @return <code>true</code> if so; <code>false</code> otherwise
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.4
0N/A */
0N/A boolean isSigned(int param) throws SQLException;
0N/A
0N/A /**
0N/A * Retrieves the designated parameter's specified column size.
0N/A *
0N/A * <P>The returned value represents the maximum column size for the given parameter.
0N/A * For numeric data, this is the maximum precision. For character data, this is the length in characters.
0N/A * For datetime datatypes, this is the length in characters of the String representation (assuming the
0N/A * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype,
0N/A * this is the length in bytes. 0 is returned for data types where the
0N/A * column size is not applicable.
0N/A *
0N/A * @param param the first parameter is 1, the second is 2, ...
0N/A * @return precision
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.4
0N/A */
0N/A int getPrecision(int param) throws SQLException;
0N/A
0N/A /**
0N/A * Retrieves the designated parameter's number of digits to right of the decimal point.
0N/A * 0 is returned for data types where the scale is not applicable.
0N/A *
0N/A * @param param the first parameter is 1, the second is 2, ...
0N/A * @return scale
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.4
0N/A */
0N/A int getScale(int param) throws SQLException;
0N/A
0N/A /**
0N/A * Retrieves the designated parameter's SQL type.
0N/A *
0N/A * @param param the first parameter is 1, the second is 2, ...
0N/A * @return SQL type from <code>java.sql.Types</code>
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.4
0N/A * @see Types
0N/A */
0N/A int getParameterType(int param) throws SQLException;
0N/A
0N/A /**
0N/A * Retrieves the designated parameter's database-specific type name.
0N/A *
0N/A * @param param the first parameter is 1, the second is 2, ...
0N/A * @return type the name used by the database. If the parameter type is
0N/A * a user-defined type, then a fully-qualified type name is returned.
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.4
0N/A */
0N/A String getParameterTypeName(int param) throws SQLException;
0N/A
0N/A
0N/A /**
0N/A * Retrieves the fully-qualified name of the Java class whose instances
0N/A * should be passed to the method <code>PreparedStatement.setObject</code>.
0N/A *
0N/A * @param param the first parameter is 1, the second is 2, ...
0N/A * @return the fully-qualified name of the class in the Java programming
0N/A * language that would be used by the method
0N/A * <code>PreparedStatement.setObject</code> to set the value
0N/A * in the specified parameter. This is the class name used
0N/A * for custom mapping.
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.4
0N/A */
0N/A String getParameterClassName(int param) throws SQLException;
0N/A
0N/A /**
0N/A * The constant indicating that the mode of the parameter is unknown.
0N/A */
0N/A int parameterModeUnknown = 0;
0N/A
0N/A /**
0N/A * The constant indicating that the parameter's mode is IN.
0N/A */
0N/A int parameterModeIn = 1;
0N/A
0N/A /**
0N/A * The constant indicating that the parameter's mode is INOUT.
0N/A */
0N/A int parameterModeInOut = 2;
0N/A
0N/A /**
0N/A * The constant indicating that the parameter's mode is OUT.
0N/A */
0N/A int parameterModeOut = 4;
0N/A
0N/A /**
0N/A * Retrieves the designated parameter's mode.
0N/A *
0N/A * @param param the first parameter is 1, the second is 2, ...
0N/A * @return mode of the parameter; one of
0N/A * <code>ParameterMetaData.parameterModeIn</code>,
0N/A * <code>ParameterMetaData.parameterModeOut</code>, or
0N/A * <code>ParameterMetaData.parameterModeInOut</code>
0N/A * <code>ParameterMetaData.parameterModeUnknown</code>.
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.4
0N/A */
0N/A int getParameterMode(int param) throws SQLException;
0N/A}