001    /*
002    // $Id: OlapParameterMetaData.java 482 2012-01-05 23:27:27Z jhyde $
003    //
004    // Licensed to Julian Hyde under one or more contributor license
005    // agreements. See the NOTICE file distributed with this work for
006    // additional information regarding copyright ownership.
007    //
008    // Julian Hyde licenses this file to you under the Apache License,
009    // Version 2.0 (the "License"); you may not use this file except in
010    // compliance with the License. You may obtain a copy of the License at:
011    //
012    // http://www.apache.org/licenses/LICENSE-2.0
013    //
014    // Unless required by applicable law or agreed to in writing, software
015    // distributed under the License is distributed on an "AS IS" BASIS,
016    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017    // See the License for the specific language governing permissions and
018    // limitations under the License.
019    */
020    package org.olap4j;
021    
022    import org.olap4j.type.Type;
023    
024    import java.sql.ParameterMetaData;
025    
026    /**
027     * Extension to {@link ParameterMetaData} for parameters of OLAP statements.
028     *
029     * <p>Chief differences:
030     * <ul>
031     * <li>An OLAP statement parameter has a name.
032     * <li>An OLAP statement parameter may be a member. If this is the case,
033     *     the {@link #getParameterType(int)} method returns
034     *     {@link java.sql.Types#OTHER}.
035     * <li>An additional method {@link #getParameterOlapType(int)} provides extra
036     *     type information; in particular, the hierarchy that a member parameter
037     *     belongs to.
038     * </ul>
039     *
040     * <p>Parameters to an OLAP statement must have default values, and therefore
041     * it is not necessary to set every parameter.
042     *
043     * @author jhyde
044     * @version $Id: OlapParameterMetaData.java 482 2012-01-05 23:27:27Z jhyde $
045     * @since Oct 12, 2006
046     */
047    public interface OlapParameterMetaData extends ParameterMetaData {
048        /**
049         * Returns the name of this parameter.
050         *
051         * @param param the first parameter is 1, the second is 2, ...
052         * @return parameter name
053         * @exception OlapException if a database access error occurs
054         */
055        String getParameterName(int param) throws OlapException;
056    
057        /**
058         * Retrieves the designated parameter's OLAP type.
059         *
060         * @param param the first parameter is 1, the second is 2, ...
061         * @return OLAP type
062         * @exception OlapException if a database access error occurs
063         */
064        Type getParameterOlapType(int param) throws OlapException;
065    }
066    
067    // End OlapParameterMetaData.java