Java Code Examples for org.pentaho.di.core.database.DatabaseMeta#TYPE_ACCESS_PLUGIN

The following examples show how to use org.pentaho.di.core.database.DatabaseMeta#TYPE_ACCESS_PLUGIN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XulDatabaseDialog.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private int convertAccessTypeToKettle( final DatabaseAccessType type ) {
  switch( type ) {
    case NATIVE:
      return DatabaseMeta.TYPE_ACCESS_NATIVE;
    case JNDI:
      return DatabaseMeta.TYPE_ACCESS_JNDI;
    case OCI:
      return DatabaseMeta.TYPE_ACCESS_OCI;
    case ODBC:
      return DatabaseMeta.TYPE_ACCESS_ODBC;
    case PLUGIN:
      return DatabaseMeta.TYPE_ACCESS_PLUGIN;
    default:
      throw new IllegalStateException();
  }
}
 
Example 2
Source File: XulDatabaseDialog.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private DatabaseAccessType convertAccessTypeFromKettle( final int type ) {
  switch( type ) {
    case DatabaseMeta.TYPE_ACCESS_NATIVE:
      return DatabaseAccessType.NATIVE;
    case DatabaseMeta.TYPE_ACCESS_JNDI:
      return DatabaseAccessType.JNDI;
    case DatabaseMeta.TYPE_ACCESS_OCI:
      return DatabaseAccessType.OCI;
    case DatabaseMeta.TYPE_ACCESS_ODBC:
      return DatabaseAccessType.ODBC;
    case DatabaseMeta.TYPE_ACCESS_PLUGIN:
      return DatabaseAccessType.PLUGIN;
    default:
      throw new IllegalStateException();
  }
}
 
Example 3
Source File: DataOverrideHandler.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void explore() {

    Shell parent = getShell();

    DatabaseMeta dbinfo = new DatabaseMeta();
    getInfo( dbinfo );

    try {
      if ( dbinfo.getAccessType() != DatabaseMeta.TYPE_ACCESS_PLUGIN ) {
        DatabaseExplorerDialog ded = new DatabaseExplorerDialog( parent, SWT.NONE, dbinfo, databases, true );
        ded.open();
      } else {
        MessageBox mb = new MessageBox( parent, SWT.OK | SWT.ICON_INFORMATION );
        mb.setText( BaseMessages.getString( PKG, "DatabaseDialog.ExplorerNotImplemented.Title" ) );
        mb.setMessage( BaseMessages.getString( PKG, "DatabaseDialog.ExplorerNotImplemented.Message" ) );
        mb.open();
      }
    } catch ( Exception e ) {
      new ErrorDialog( parent, BaseMessages.getString( PKG, "DatabaseDialog.ErrorParameters.title" ), BaseMessages
        .getString( PKG, "DatabaseDialog.ErrorParameters.description" ), e );
    }
  }
 
Example 4
Source File: CreateDatabaseWizardPage1.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public IWizardPage getNextPage() {
  IWizard wiz = getWizard();

  IWizardPage nextPage;
  switch ( databaseMeta.getAccessType() ) {
    case DatabaseMeta.TYPE_ACCESS_OCI:
      nextPage = wiz.getPage( "oci" ); // OCI
      break;
    case DatabaseMeta.TYPE_ACCESS_ODBC:
      nextPage = wiz.getPage( "odbc" ); // ODBC
      break;
    case DatabaseMeta.TYPE_ACCESS_PLUGIN:
      nextPage = wiz.getPage( databaseMeta.getPluginId() ); // e.g. SAPR3
      break;
    default: // Generic or Native
      if ( databaseMeta.getDatabaseInterface() instanceof GenericDatabaseMeta ) { // Generic
        nextPage = wiz.getPage( "generic" ); // generic
      } else { // Native
        nextPage = wiz.getPage( "jdbc" );
        if ( nextPage != null ) {
          // Set the port number...
          ( (CreateDatabaseWizardPageJDBC) nextPage ).setData();
        }
      }
      break;
  }

  return nextPage;
}
 
Example 5
Source File: SAPR3DatabaseMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
@Override
public int[] getAccessTypeList() {
  return new int[] { DatabaseMeta.TYPE_ACCESS_PLUGIN };
}