public String[] getTablenames( boolean includeSchema ) throws KettleDatabaseException { return getTablenames( null, includeSchema ); }
public String[] getTablenames() throws KettleDatabaseException { return getTablenames( false ); }
public String[] getTablenames( String schemanamein, boolean includeSchema ) throws KettleDatabaseException { return getTablenames( schemanamein, includeSchema, null ); }
public boolean getInputData() { // Get some data... RipDatabaseWizardPage1 page1 = (RipDatabaseWizardPage1) getPreviousPage(); Database sourceDb = new Database( RipDatabaseWizard.loggingObject, page1.getSourceDatabase() ); try { sourceDb.connect(); input = sourceDb.getTablenames( false ); // Don't include the schema since it can cause invalid syntax } catch ( KettleDatabaseException dbe ) { new ErrorDialog( shell, "Error getting tables", "Error obtaining table list from database!", dbe ); input = null; return false; } finally { sourceDb.disconnect(); } return true; }
public boolean getInputData() { // Get some data... CopyTableWizardPage1 page1 = (CopyTableWizardPage1) getPreviousPage(); Database sourceDb = new Database( CopyTableWizard.loggingObject, page1.getSourceDatabase() ); try { sourceDb.connect(); input = sourceDb.getTablenames(); } catch ( KettleDatabaseException dbe ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "CopyTableWizardPage2.ErrorGettingTables.DialogTitle" ), BaseMessages.getString( PKG, "CopyTableWizardPage2.ErrorGettingTables.DialogMessage" ), dbe ); input = null; return false; } finally { sourceDb.disconnect(); } return true; }
monitor.subTask( BaseMessages.getString( PKG, "DatabaseMeta.Info.GettingTables" ) ); setTables( db.getTablenames( databaseMeta.supportsSchemas() ) ); // legacy call setTableMap( db.getTableMap() ); if ( monitor != null ) {
try { database.connect(); String[] Tablenames = database.getTablenames(); Arrays.sort( Tablenames ); EnterSelectionDialog dialog = new EnterSelectionDialog( shell, Tablenames,
String[] tableNames = data.db.getTablenames( data.realSchemaName, meta.isAddSchemaInOut() );
public List<String> getDatabaseTables( IDatabaseConnection connection, String schema ) throws DatasourceServiceException { try { DatabaseMeta databaseMeta = this.getDatabaseMeta( connection ); Database database = new Database( null, databaseMeta ); database.connect(); String[] tableNames = database.getTablenames( schema, true, this.isDataServicesConnection( connection ) ? new HashMap<String, String>() {{ put( "STREAMING", "N" ); }} : null ); List<String> tables = new ArrayList<String>(); tables.addAll( Arrays.asList( tableNames ) ); tables.addAll( Arrays.asList( database.getViews( schema, true ) ) ); database.disconnect(); return tables; } catch ( KettleDatabaseException e ) { logger.error( "Error creating database object", e ); throw new DatasourceServiceException( e ); } catch ( ConnectionServiceException e ) { logger.error( "Error getting database meta", e ); throw new DatasourceServiceException( e ); } }