public DatabaseMetaInformation open() { final DatabaseMetaInformation dmi = new DatabaseMetaInformation( dbInfo ); IRunnableWithProgress op = new IRunnableWithProgress() { public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException { try { dmi.getData( Spoon.loggingObject, new ProgressMonitorAdapter( monitor ) ); } catch ( Exception e ) { throw new InvocationTargetException( e, BaseMessages.getString( PKG, "GetDatabaseInfoProgressDialog.Error.GettingInfoTable", e.toString() ) ); } } }; try { ProgressMonitorDialog pmd = new ProgressMonitorDialog( shell ); pmd.run( true, true, op ); } catch ( InvocationTargetException e ) { showErrorDialog( e ); return null; } catch ( InterruptedException e ) { showErrorDialog( e ); return null; } return dmi; }
public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException { try { dmi.getData( Spoon.loggingObject, new ProgressMonitorAdapter( monitor ) ); } catch ( Exception e ) { throw new InvocationTargetException( e, BaseMessages.getString( PKG, "GetDatabaseInfoProgressDialog.Error.GettingInfoTable", e.toString() ) ); } } };
setCatalogs( catalogList.toArray( new Catalog[catalogList.size()] ) ); setSchemas( schemaList.toArray( new Schema[schemaList.size()] ) ); monitor.subTask( BaseMessages.getString( PKG, "DatabaseMeta.Info.GettingTables" ) ); setTables( db.getTablenames( databaseMeta.supportsSchemas() ) ); // legacy call setTableMap( db.getTableMap() ); if ( monitor != null ) { monitor.worked( 1 ); setViews( db.getViews( databaseMeta.supportsSchemas() ) ); // legacy call setViewMap( db.getViewMap() ); setSynonyms( db.getSynonyms( databaseMeta.supportsSchemas() ) ); // legacy call setSynonymMap( db.getSynonymMap() ); monitor.subTask( BaseMessages.getString( PKG, "DatabaseMeta.Info.GettingProcedures" ) ); setProcedures( db.getProcedures() ); if ( monitor != null ) { monitor.worked( 1 );
DatabaseMetaInformation dmi = new DatabaseMetaInformation( databaseMeta ); dmi.getData( new LoggingObject( "Auto Modeler" ), null ); // reads the metadata from the database, optional String schemaName = dmi.getSchemas()[0].getSchemaName(); // for example, we String[] tableNames = dmi.getSchemas()[0].getItems(); // for example, all
Schema[] schemas = dmi.getSchemas(); if ( schemas != null ) { DatabaseExplorerNode theSchemaNode = null; Map<String, Collection<String>> tableMap = dmi.getTableMap(); List<String> tableKeys = new ArrayList<String>( tableMap.keySet() ); Collections.sort( tableKeys ); Map<String, Collection<String>> viewMap = dmi.getViewMap(); if ( viewMap != null ) { List<String> viewKeys = new ArrayList<String>( viewMap.keySet() ); Map<String, Collection<String>> synonymMap = dmi.getSynonymMap(); if ( synonymMap != null ) { List<String> synonymKeys = new ArrayList<String>( synonymMap.keySet() );
DatabaseMetaInformation dmi = new DatabaseMetaInformation( databaseMeta ); dmi.getData( new LoggingObject( "Auto Modeler" ), null ); // reads the metadata from the database, optional progress String schemaName = dmi.getSchemas()[0].getSchemaName(); // for example, we take the first... String[] tableNames = dmi.getSchemas()[0].getItems(); // for example, all tables from the first schema