Code Search for Developers
 
 
  

Connection.java from BIRT at Krugle


Show Connection.java syntax highlighted

/*
 *************************************************************************
 * 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 java.util.Properties;

import org.eclipse.datatools.connectivity.oda.IConnection;
import org.eclipse.datatools.connectivity.oda.IDataSetMetaData;
import org.eclipse.datatools.connectivity.oda.IQuery;
import org.eclipse.datatools.connectivity.oda.OdaException;

/**
 * Connection is the DTP ODA adapter for the BIRT ODA driver interface IConnection.
 */
public class Connection implements IConnection
{
    
    private org.eclipse.birt.data.oda.IConnection m_birtConnection = null;
    
    private Connection()
    {
        
    }
    
    /**
     * Creates a Connection adapter for the specified object.
     * @param birtConnection		BIRT ODA IConnection interface implementation.
     */
    public Connection( org.eclipse.birt.data.oda.IConnection birtConnection )
    {
        m_birtConnection = birtConnection;
    }
    
	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IConnection#open(java.util.Properties)
	 */
	public void open( Properties connProperties ) throws OdaException
	{
		try
        {
            m_birtConnection.open( connProperties );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IConnection#setAppContext(java.lang.Object)
	 */
	public void setAppContext( Object context ) throws OdaException
	{
	    // do nothing; ODA 2.0 driver does not support pass-through context
	}	

	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IConnection#close()
	 */
	public void close() throws OdaException
	{
		try
        {
            m_birtConnection.close();
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IConnection#isOpen()
	 */
	public boolean isOpen() throws OdaException
	{
		try
        {
		    return m_birtConnection.isOpen();
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IConnection#getMetaData(java.lang.String)
	 */
	public IDataSetMetaData getMetaData( String dataSetType )
			throws OdaException
	{
		try
        {
            return new DataSetMetaData( m_birtConnection.getMetaData( dataSetType ) );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IConnection#newQuery(java.lang.String)
	 */
	public IQuery newQuery( String dataSetType )
			throws OdaException
	{
		try
        {
		    org.eclipse.birt.data.oda.IQuery query = m_birtConnection.newQuery( dataSetType );
		    
		   if ( query instanceof org.eclipse.birt.data.oda.IAdvancedQuery )
		        return new AdvancedQuery( ( org.eclipse.birt.data.oda.IAdvancedQuery ) query );
		   
		   return new Query( query );
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IConnection#commit()
	 */
	public void commit( ) throws OdaException
	{
		try
        {
            m_birtConnection.commit();
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.IConnection#rollback()
	 */
	public void rollback( ) throws OdaException
	{
		try
        {
            m_birtConnection.rollback();
        }
        catch( org.eclipse.birt.data.oda.OdaException e )
        {
            throw new OdaAdapterException( e );
        }
	}

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




See more files for this project here

BIRT

BIRT is an open source, Eclipse-based reporting system that integrates with your application to produce compelling reports for both web and PDF.

Project homepage: http://www.eclipse.org/birt/phoenix/
Programming language(s): Java,XML
License: gpl2

  plugin/
    DriverPlugin.java
  AdvancedQuery.java
  Connection.java
  DataSetMetaData.java
  Driver.java
  OdaAdapterException.java
  ParameterMetaData.java
  ParameterRowSet.java
  Query.java
  ResultSet.java
  ResultSetMetaData.java
  package.html