public GetTableSizeProgressDialog( Shell shell, DatabaseMeta dbInfo, String tableName, String schemaName ) { this.shell = shell; this.dbMeta = dbInfo; this.tableName = dbInfo.getQuotedSchemaTableCombination( schemaName, tableName ); }
/** * Creates a new dialog that will handle the wait while we're doing the hard work. */ public GetPreviewTableProgressDialog( Shell shell, DatabaseMeta dbInfo, String schemaName, String tableName, int limit ) { this.shell = shell; this.dbMeta = dbInfo; this.tableName = dbInfo.getQuotedSchemaTableCombination( schemaName, tableName ); this.limit = limit; }
public XulStepFieldsDialog( Shell aShell, int aStyle, DatabaseMeta aDatabaseMeta, String aTableName, RowMetaInterface anInput, String schemaName ) { this.shell = aShell; this.schemaTableCombo = aDatabaseMeta.getQuotedSchemaTableCombination( schemaName, aTableName ); this.databaseMeta = aDatabaseMeta; this.rowMeta = anInput; }
/** * This is now replaced with getQuotedSchemaTableCombination(), enforcing the use of the quoteFields call * * @param schemaName * @param tableName * @return * @deprecated please use getQuotedSchemaTableCombination() */ @Deprecated public String getSchemaTableCombination( String schemaName, String tableName ) { return getQuotedSchemaTableCombination( schemaName, tableName ); }
private String[] getQuotedSchemaTablenames( String[] tables ) { String[] quoted = new String[ tables.length ]; for ( int i = 0; i < quoted.length; i++ ) { quoted[ i ] = database.getDatabaseMeta().getQuotedSchemaTableCombination( null, tables[ i ] ); } return quoted; }
/** * @param tableName * The tablename to be truncated * @return The SQL statement to remove all rows from the specified statement, if possible without using transactions */ public String getTruncateTableStatement( String schema, String tableName ) { return databaseInterface.getTruncateTableStatement( getQuotedSchemaTableCombination( schema, tableName ) ); }
public String[] getTablenames( String schemanamein, boolean includeSchema, Map<String, String> props ) throws KettleDatabaseException { Map<String, Collection<String>> tableMap = getTableMap( schemanamein, props ); List<String> res = new ArrayList<String>(); for ( String schema : tableMap.keySet() ) { Collection<String> tables = tableMap.get( schema ); for ( String table : tables ) { if ( includeSchema ) { res.add( databaseMeta.getQuotedSchemaTableCombination( schema, table ) ); } else { res.add( databaseMeta.getQuotedSchemaTableCombination( null, table ) ); } } } return res.toArray( new String[ res.size() ] ); }
public String quoteTable( String table ) { return repository.connectionDelegate.getDatabaseMeta().getQuotedSchemaTableCombination( null, table ); } }
public String quoteTable( String table ) { return repositoryMeta.getConnection().getQuotedSchemaTableCombination( null, table ); }
private String getSchemaAndTable( XulDatabaseExplorerModel model, DatabaseMeta meta ) { if ( model.getSchema() != null ) { return meta.getQuotedSchemaTableCombination( model.getSchema(), model.getTable() ); } else { return meta.getQuotedSchemaTableCombination( null, model.getTable() ); } }
public synchronized LongObjectId getNextJobEntryAttributeID() throws KettleException { return getNextID( databaseMeta.getQuotedSchemaTableCombination( null, KettleDatabaseRepository.TABLE_R_JOBENTRY_ATTRIBUTE ), quote( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_ID_JOBENTRY_ATTRIBUTE ) ); }
protected RowMetaInterface getDatabaseTableFields( Database db, String schemaName, String tableName ) throws KettleDatabaseException { // First try without connecting to the database... (can be S L O W) String schemaTable = databaseMeta.getQuotedSchemaTableCombination( schemaName, tableName ); RowMetaInterface extraFields = db.getTableFields( schemaTable ); if ( extraFields == null ) { // now we need to connect db.connect(); extraFields = db.getTableFields( schemaTable ); } return extraFields; }
@Override public Long getNextBatchIdUsingLockTables( DatabaseMeta dbm, Database ldb, String schemaName, String tableName, String fieldName ) throws KettleDatabaseException { Long rtn = null; // Make sure we lock that table to avoid concurrency issues ldb.lockTables( new String[] { dbm.getQuotedSchemaTableCombination( schemaName, tableName ), } ); try { rtn = ldb.getNextValue( null, schemaName, tableName, fieldName ); } finally { ldb.unlockTables( new String[] { tableName, } ); } return rtn; }
public String getQuotedSchemaTableCombination() { return getDatabaseMeta().getQuotedSchemaTableCombination( getActualSchemaName(), getActualTableName() ); }
private String buildTargetTableString( VariableSpace space ) { return databaseMeta.getQuotedSchemaTableCombination( space.environmentSubstitute( getSchemaName() ), space .environmentSubstitute( getTableName() ) ); }
public synchronized void setLookupJobAttribute() throws KettleException { String sql = "SELECT " + quote( KettleDatabaseRepository.FIELD_JOB_ATTRIBUTE_VALUE_STR ) + ", " + quote( KettleDatabaseRepository.FIELD_JOB_ATTRIBUTE_VALUE_NUM ) + " FROM " + databaseMeta.getQuotedSchemaTableCombination( null, KettleDatabaseRepository.TABLE_R_JOB_ATTRIBUTE ) + " WHERE " + quote( KettleDatabaseRepository.FIELD_JOB_ATTRIBUTE_ID_JOB ) + " = ? AND " + quote( KettleDatabaseRepository.FIELD_JOB_ATTRIBUTE_CODE ) + " = ? AND " + KettleDatabaseRepository.FIELD_JOB_ATTRIBUTE_NR + " = ? "; psJobAttributesLookup = database.prepareSQL( sql ); }
public synchronized void setLookupTransAttribute() throws KettleException { String sql = "SELECT " + quote( KettleDatabaseRepository.FIELD_TRANS_ATTRIBUTE_VALUE_STR ) + ", " + quote( KettleDatabaseRepository.FIELD_TRANS_ATTRIBUTE_VALUE_NUM ) + " FROM " + databaseMeta .getQuotedSchemaTableCombination( null, KettleDatabaseRepository.TABLE_R_TRANS_ATTRIBUTE ) + " WHERE " + quote( KettleDatabaseRepository.FIELD_TRANS_ATTRIBUTE_ID_TRANSFORMATION ) + " = ? AND " + quote( KettleDatabaseRepository.FIELD_TRANS_ATTRIBUTE_CODE ) + " = ? AND " + KettleDatabaseRepository.FIELD_TRANS_ATTRIBUTE_NR + " = ? "; psTransAttributesLookup = database.prepareSQL( sql ); }
public synchronized void setLookupStepAttribute() throws KettleException { String sql = "SELECT " + quote( KettleDatabaseRepository.FIELD_STEP_ATTRIBUTE_VALUE_STR ) + ", " + quote( KettleDatabaseRepository.FIELD_STEP_ATTRIBUTE_VALUE_NUM ) + " FROM " + databaseMeta.getQuotedSchemaTableCombination( null, KettleDatabaseRepository.TABLE_R_STEP_ATTRIBUTE ) + " WHERE " + quote( KettleDatabaseRepository.FIELD_STEP_ATTRIBUTE_ID_STEP ) + " = ? AND " + quote( KettleDatabaseRepository.FIELD_STEP_ATTRIBUTE_CODE ) + " = ? AND " + quote( KettleDatabaseRepository.FIELD_STEP_ATTRIBUTE_NR ) + " = ? "; psStepAttributesLookup = database.prepareSQL( sql ); }
public synchronized void setLookupJobEntryAttribute() throws KettleException { String sql = "SELECT " + quote( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_VALUE_STR ) + ", " + quote( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_VALUE_NUM ) + " FROM " + databaseMeta.getQuotedSchemaTableCombination( null, KettleDatabaseRepository.TABLE_R_JOBENTRY_ATTRIBUTE ) + " WHERE " + quote( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_ID_JOBENTRY ) + " = ? AND " + quote( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_CODE ) + " = ? AND " + quote( KettleDatabaseRepository.FIELD_JOBENTRY_ATTRIBUTE_NR ) + " = ? "; pstmt_entry_attributes = database.prepareSQL( sql ); }
public void truncateTable( String schema, String tablename ) throws KettleDatabaseException { if ( Utils.isEmpty( connectionGroup ) ) { String truncateStatement = databaseMeta.getTruncateTableStatement( schema, tablename ); if ( truncateStatement == null ) { throw new KettleDatabaseException( "Truncate table not supported by " + databaseMeta.getDatabaseInterface().getPluginName() ); } execStatement( truncateStatement ); } else { execStatement( "DELETE FROM " + databaseMeta.getQuotedSchemaTableCombination( schema, tablename ) ); } }