| /* |
| ************************************************************************* |
| * Copyright (c) 2004, 2009 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.datatools.connectivity.oda.impl; |
| |
| import java.math.BigDecimal; |
| import java.sql.Date; |
| import java.sql.Time; |
| import java.sql.Timestamp; |
| |
| import org.eclipse.datatools.connectivity.oda.IBlob; |
| import org.eclipse.datatools.connectivity.oda.IClob; |
| import org.eclipse.datatools.connectivity.oda.IResultSet; |
| import org.eclipse.datatools.connectivity.oda.IResultSetMetaData; |
| import org.eclipse.datatools.connectivity.oda.OdaException; |
| |
| /** |
| * Default implementation of IResultSet |
| * for a simple ODA runtime driver. |
| * @deprecated As of 3.1.2, see package documentation. |
| */ |
| public class SimpleResultSet implements IResultSet |
| { |
| private int m_maxRows; |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getMetaData() |
| */ |
| public IResultSetMetaData getMetaData() throws OdaException |
| { |
| return new SimpleResultSetMetaData(); |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#setMaxRows(int) |
| */ |
| public void setMaxRows( int max ) throws OdaException |
| { |
| m_maxRows = max; |
| } |
| |
| /** |
| * Returns the maximum number of rows that can be fetched from this result set. |
| * @return the maximum number of rows to fetch. |
| */ |
| protected int getMaxRows() |
| { |
| return m_maxRows; |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#next() |
| */ |
| public boolean next() throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#close() |
| */ |
| public void close() throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getRow() |
| */ |
| public int getRow() throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getString(int) |
| */ |
| public String getString( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getString(java.lang.String) |
| */ |
| public String getString( String columnName ) throws OdaException |
| { |
| return getString( findColumn( columnName ) ); |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getInt(int) |
| */ |
| public int getInt( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getInt(java.lang.String) |
| */ |
| public int getInt( String columnName ) throws OdaException |
| { |
| return getInt( findColumn( columnName ) ); |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getDouble(int) |
| */ |
| public double getDouble( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getDouble(java.lang.String) |
| */ |
| public double getDouble( String columnName ) throws OdaException |
| { |
| return getDouble( findColumn( columnName ) ); |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getBigDecimal(int) |
| */ |
| public BigDecimal getBigDecimal( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getBigDecimal(java.lang.String) |
| */ |
| public BigDecimal getBigDecimal( String columnName ) throws OdaException |
| { |
| return getBigDecimal( findColumn( columnName ) ); |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getDate(int) |
| */ |
| public Date getDate( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getDate(java.lang.String) |
| */ |
| public Date getDate( String columnName ) throws OdaException |
| { |
| return getDate( findColumn( columnName ) ); |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getTime(int) |
| */ |
| public Time getTime( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getTime(java.lang.String) |
| */ |
| public Time getTime( String columnName ) throws OdaException |
| { |
| return getTime( findColumn( columnName ) ); |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getTimestamp(int) |
| */ |
| public Timestamp getTimestamp( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getTimestamp(java.lang.String) |
| */ |
| public Timestamp getTimestamp( String columnName ) throws OdaException |
| { |
| return getTimestamp( findColumn( columnName ) ); |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#wasNull() |
| */ |
| public boolean wasNull() throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /** |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#findColumn(java.lang.String) |
| */ |
| public int findColumn( String columnName ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getBlob(int) |
| */ |
| public IBlob getBlob( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getBlob(java.lang.String) |
| */ |
| public IBlob getBlob( String columnName ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getClob(int) |
| */ |
| public IClob getClob( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getClob(java.lang.String) |
| */ |
| public IClob getClob( String columnName ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getBoolean(int) |
| */ |
| public boolean getBoolean( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getBoolean(java.lang.String) |
| */ |
| public boolean getBoolean( String columnName ) throws OdaException |
| { |
| return getBoolean( findColumn( columnName ) ); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getObject(int) |
| */ |
| public Object getObject( int index ) throws OdaException |
| { |
| // TODO data source dependent |
| throw new UnsupportedOperationException( "Please override and implement me." ); //$NON-NLS-1$ |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.datatools.connectivity.oda.IResultSet#getObject(java.lang.String) |
| */ |
| public Object getObject( String columnName ) throws OdaException |
| { |
| return getObject( findColumn( columnName ) ); |
| } |
| |
| } |