001    /*
002    // $Id: OlapParameterMetaData.java 229 2009-05-08 19:11:29Z jhyde $
003    // This software is subject to the terms of the Eclipse Public License v1.0
004    // Agreement, available at the following URL:
005    // http://www.eclipse.org/legal/epl-v10.html.
006    // Copyright (C) 2006-2008 Julian Hyde
007    // All Rights Reserved.
008    // You must accept the terms of that agreement to use this software.
009    */
010    package org.olap4j;
011    
012    import org.olap4j.type.Type;
013    
014    import java.sql.ParameterMetaData;
015    
016    /**
017     * Extension to {@link ParameterMetaData} for parameters of OLAP statements.
018     *
019     * <p>Chief differences:
020     * <ul>
021     * <li>An OLAP statement parameter has a name.
022     * <li>An OLAP statement parameter may be a member. If this is the case,
023     *     the {@link #getParameterType(int)} method returns
024     *     {@link java.sql.Types#OTHER}.
025     * <li>An additional method {@link #getParameterOlapType(int)} provides extra
026     *     type information; in particular, the hierarchy that a member parameter
027     *     belongs to.
028     * </ul>
029     *
030     * <p>Parameters to an OLAP statement must have default values, and therefore
031     * it is not necessary to set every parameter.
032     *
033     * @author jhyde
034     * @version $Id: OlapParameterMetaData.java 229 2009-05-08 19:11:29Z jhyde $
035     * @since Oct 12, 2006
036     */
037    public interface OlapParameterMetaData extends ParameterMetaData {
038        /**
039         * Returns the name of this parameter.
040         *
041         * @param param the first parameter is 1, the second is 2, ...
042         * @return parameter name
043         * @exception OlapException if a database access error occurs
044         */
045        String getParameterName(int param) throws OlapException;
046    
047        /**
048         * Retrieves the designated parameter's OLAP type.
049         *
050         * @param param the first parameter is 1, the second is 2, ...
051         * @return OLAP type
052         * @exception OlapException if a database access error occurs
053         */
054        Type getParameterOlapType(int param) throws OlapException;
055    }
056    
057    // End OlapParameterMetaData.java