/*
 *************************************************************************
 * Copyright (c) 2004, 2005 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *  
 *************************************************************************
 */

package org.eclipse.birt.data.oda.adapter.dtp;

import org.eclipse.datatools.connectivity.oda.IResultSetMetaData;
import org.eclipse.datatools.connectivity.oda.OdaException;

/**
 * ResultSetMetaData is the DTP ODA adapter for the BIRT ODA driver interface IResultSetMetaData.
 */
public class ResultSetMetaData implements IResultSetMetaData
{

    private org.eclipse.birt.data.oda.IResultSetMetaData m_birtResultSetMetaData = null;
    
    private ResultSetMetaData()
    {
        
    }
    
	/**
	 * Creates a ResultSetMetaData adapter for the specified object.
	 * @param birtResultSetMetaData		BIRT ODA IResultSetMetaData interface implementation.
	 * @throws OdaException				if data source error occurs.
	 */
	public ResultSetMetaData( org.eclipse.birt.data.oda.IResultSetMetaData birtResultSetMetaData )
			throws OdaException
	{
		m_birtResultSetMetaData = birtResultSetMetaData;
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IResultSetMetaData#getColumnCount()
	 */
	public int getColumnCount() throws OdaException
	{
		try
        {
            return m_birtResultSetMetaData.getColumnCount();
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IResultSetMetaData#getColumnName(int)
	 */
	public String getColumnName( int index ) throws OdaException
	{
	    try
        {
            return m_birtResultSetMetaData.getColumnName( index );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IResultSetMetaData#getColumnLabel(int)
	 */
	public String getColumnLabel( int index ) throws OdaException
	{
	    try
        {
            return m_birtResultSetMetaData.getColumnLabel( index );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IResultSetMetaData#getColumnType(int)
	 */
	public int getColumnType( int index ) throws OdaException
	{
	    try
        {
            return m_birtResultSetMetaData.getColumnType( index );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IResultSetMetaData#getColumnTypeName(int)
	 */
	public String getColumnTypeName( int index ) throws OdaException
	{
	    try
        {
            return m_birtResultSetMetaData.getColumnTypeName( index );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IResultSetMetaData#getColumnDisplayLength(int)
	 */
	public int getColumnDisplayLength( int index ) throws OdaException
	{
	    try
        {
            return m_birtResultSetMetaData.getColumnDisplayLength( index );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IResultSetMetaData#getPrecision(int)
	 */
	public int getPrecision( int index ) throws OdaException
	{
	    try
        {
            return m_birtResultSetMetaData.getPrecision( index );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }

	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IResultSetMetaData#getScale(int)
	 */
	public int getScale( int index ) throws OdaException
	{
	    try
        {
            return m_birtResultSetMetaData.getScale( index );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}


	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IResultSetMetaData#isNullable(int)
	 */
	public int isNullable( int index ) throws OdaException
	{
	    try
        {
            return m_birtResultSetMetaData.isNullable( index );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}
}