/**
SpagoBI, the Open Source Business Intelligence suite
Copyright (C) 2012 Engineering Ingegneria Informatica S.p.A. - SpagoBI Competency Center
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at http://mozilla.org/MPL/2.0/.
**/
package it.eng.spagobi.studio.oda.impl;
import org.eclipse.datatools.connectivity.oda.IConnection;
import org.eclipse.datatools.connectivity.oda.IDataSetMetaData;
import org.eclipse.datatools.connectivity.oda.IResultSet;
import org.eclipse.datatools.connectivity.oda.OdaException;
/**
* Implementation class of IDataSetMetaData for an ODA runtime driver.
* <br>
* For demo purpose, the auto-generated method stubs have
* hard-coded implementation that assume this custom ODA data set
* is capable of handling a query that returns a single result set and
* accepts scalar input parameters by index.
* A custom ODA driver is expected to implement own data set specific
* behavior in its place.
*/
public class DataSetMetaData implements IDataSetMetaData
{
private IConnection m_connection;
DataSetMetaData( IConnection connection )
{
m_connection = connection;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#getConnection()
*/
public IConnection getConnection() throws OdaException
{
// TODO Auto-generated method stub
return m_connection;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#getDataSourceObjects(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
*/
public IResultSet getDataSourceObjects( String catalog, String schema, String object, String version ) throws OdaException
{
throw new UnsupportedOperationException();
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#getDataSourceMajorVersion()
*/
public int getDataSourceMajorVersion() throws OdaException
{
// TODO Auto-generated method stub
return 1;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#getDataSourceMinorVersion()
*/
public int getDataSourceMinorVersion() throws OdaException
{
// TODO Auto-generated method stub
return 0;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#getDataSourceProductName()
*/
public String getDataSourceProductName() throws OdaException
{
// TODO Auto-generated method stub
return "SpagoBI Data Source";
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#getDataSourceProductVersion()
*/
public String getDataSourceProductVersion() throws OdaException
{
return Integer.toString( getDataSourceMajorVersion() ) + "." + //$NON-NLS-1$
Integer.toString( getDataSourceMinorVersion() );
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#getSQLStateType()
*/
public int getSQLStateType() throws OdaException
{
// TODO Auto-generated method stub
return IDataSetMetaData.sqlStateSQL99;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#supportsMultipleResultSets()
*/
public boolean supportsMultipleResultSets() throws OdaException
{
return false;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#supportsMultipleOpenResults()
*/
public boolean supportsMultipleOpenResults() throws OdaException
{
return false;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#supportsNamedResultSets()
*/
public boolean supportsNamedResultSets() throws OdaException
{
return false;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#supportsNamedParameters()
*/
public boolean supportsNamedParameters() throws OdaException
{
// TODO Auto-generated method stub
return false;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#supportsInParameters()
*/
public boolean supportsInParameters() throws OdaException
{
// TODO Auto-generated method stub
return true;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#supportsOutParameters()
*/
public boolean supportsOutParameters() throws OdaException
{
// TODO Auto-generated method stub
return false;
}
/*
* @see org.eclipse.datatools.connectivity.oda.IDataSetMetaData#getSortMode()
*/
public int getSortMode()
{
// TODO Auto-generated method stub
return IDataSetMetaData.sortModeNone;
}
}