本文整理汇总了Java中org.pentaho.di.core.database.Database.checkTableExists方法的典型用法代码示例。如果您正苦于以下问题:Java Database.checkTableExists方法的具体用法?Java Database.checkTableExists怎么用?Java Database.checkTableExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.database.Database
的用法示例。
在下文中一共展示了Database.checkTableExists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
/**
* Gets a list of fields in the database table
* @param space The variable space
* @return The metadata about the fields in the table.
* @throws KettleException
*/
public RowMetaInterface getRequiredFields( VariableSpace space ) throws KettleException {
String realTableName = space.environmentSubstitute( targetTable );
String realSchemaName = space.environmentSubstitute( targetSchema );
if ( databaseMeta != null ) {
Database db = new Database( loggingObject, databaseMeta );
try {
db.connect();
if ( !Const.isEmpty( realTableName ) ) {
String schemaTable = databaseMeta.getQuotedSchemaTableCombination( realSchemaName, realTableName );
// Check if this table exists...
if ( db.checkTableExists( schemaTable ) ) {
return db.getTableFields( schemaTable );
} else {
throw new KettleException( BaseMessages.getString( PKG, "SnowflakeBulkLoaderMeta.Exception.TableNotFound" ) );
}
} else {
throw new KettleException( BaseMessages.getString( PKG, "SnowflakeBulkLoaderMeta.Exception.TableNotSpecified" ) );
}
} catch ( Exception e ) {
throw new KettleException(
BaseMessages.getString( PKG, "SnowflakeBulkLoaderMeta.Exception.ErrorGettingFields" ), e );
} finally {
db.disconnect();
}
} else {
throw new KettleException( BaseMessages.getString( PKG, "SnowflakeBulkLoaderMeta.Exception.ConnectionNotDefined" ) );
}
}
示例2: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException {
String realTableName = space.environmentSubstitute(tableName);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta != null) {
Database db = new Database(loggingObject, databaseMeta);
try {
db.connect();
if (!Const.isEmpty(realTableName)) {
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable)) {
RowMetaInterface rv = db.getTableFields(schemaTable);
return rv;
} else {
throw new KettleException(BaseMessages.getString(PKG, "TeraDataBulkLoaderMeta.Exception.TableNotFound"));
}
} else {
throw new KettleException(BaseMessages.getString(PKG, "TeraDataBulkLoaderMeta.Exception.TableNotSpecified"));
}
} catch (Exception e) {
throw new KettleException(BaseMessages.getString(PKG, "TeraDataBulkLoaderMeta.Exception.ErrorGettingFields"), e);
} finally {
db.disconnect();
}
} else {
throw new KettleException(BaseMessages.getString(PKG, "TeraDataBulkLoaderMeta.Exception.ConnectionNotDefined"));
}
}
示例3: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space)
throws KettleException {
String realTableName = space.environmentSubstitute(tableName);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta != null) {
Database db = new Database(loggingObject, databaseMeta);
try {
db.connect();
if (!Const.isEmpty(realTableName)) {
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(
realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable)) {
return db.getTableFields(schemaTable);
} else {
throw new KettleException(BaseMessages.getString(PKG,
"LucidDBStreamingLoaderMeta.Exception.TableNotFound"));
}
} else {
throw new KettleException(BaseMessages.getString(PKG,
"LucidDBStreamingLoaderMeta.Exception.TableNotSpecified"));
}
} catch (Exception e) {
throw new KettleException(BaseMessages.getString(PKG,
"LucidDBStreamingLoaderMeta.Exception.ErrorGettingFields"), e);
} finally {
db.disconnect();
}
} else {
throw new KettleException(BaseMessages.getString(PKG,
"LucidDBStreamingLoaderMeta.Exception.ConnectionNotDefined"));
}
}
示例4: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException {
String realTableName = space.environmentSubstitute(tablename);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta != null) {
Database db = new Database(databaseMeta);
try {
db.connect();
if (!Const.isEmpty(realTableName)) {
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable)) {
return db.getTableFields(schemaTable);
} else {
throw new KettleException(Messages.getString("SQLFileOutputMeta.Exception.TableNotFound"));
}
} else {
throw new KettleException(Messages.getString("SQLFileOutputMeta.Exception.TableNotSpecified"));
}
} catch (Exception e) {
throw new KettleException(Messages.getString("SQLFileOutputMeta.Exception.ErrorGettingFields"), e);
} finally {
db.disconnect();
}
} else {
throw new KettleException(Messages.getString("SQLFileOutputMeta.Exception.ConnectionNotDefined"));
}
}
示例5: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException {
String realTableName = space.environmentSubstitute(tablename);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta != null) {
Database db = new Database(loggingObject, databaseMeta);
try {
db.connect();
if (!Const.isEmpty(realTableName)) {
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable)) {
return db.getTableFields(schemaTable);
} else {
throw new KettleException(BaseMessages.getString(PKG, "SQLFileOutputMeta.Exception.TableNotFound"));
}
} else {
throw new KettleException(BaseMessages.getString(PKG, "SQLFileOutputMeta.Exception.TableNotSpecified"));
}
} catch (Exception e) {
throw new KettleException(BaseMessages.getString(PKG, "SQLFileOutputMeta.Exception.ErrorGettingFields"), e);
} finally {
db.disconnect();
}
} else {
throw new KettleException(BaseMessages.getString(PKG, "SQLFileOutputMeta.Exception.ConnectionNotDefined"));
}
}
示例6: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
{
String realTableName = space.environmentSubstitute(tableName);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta!=null)
{
Database db = new Database(loggingObject, databaseMeta);
try
{
db.connect();
if (!Const.isEmpty(realTableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable))
{
return db.getTableFields(schemaTable);
}
else
{
throw new KettleException(BaseMessages.getString(PKG, "SynchronizeAfterMergeMeta.Exception.TableNotFound"));
}
}
else
{
throw new KettleException(BaseMessages.getString(PKG, "SynchronizeAfterMergeMeta.Exception.TableNotSpecified"));
}
}
catch(Exception e)
{
throw new KettleException(BaseMessages.getString(PKG, "SynchronizeAfterMergeMeta.Exception.ErrorGettingFields"), e);
}
finally
{
db.disconnect();
}
}
else
{
throw new KettleException(BaseMessages.getString(PKG, "SynchronizeAfterMergeMeta.Exception.ConnectionNotDefined"));
}
}
示例7: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
{
String realTableName = space.environmentSubstitute(tableName);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta!=null)
{
Database db = new Database(loggingObject, databaseMeta);
try
{
db.connect();
if (!Const.isEmpty(realTableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable))
{
return db.getTableFields(schemaTable);
}
else
{
throw new KettleException(BaseMessages.getString(PKG, "GPBulkLoaderMeta.Exception.TableNotFound"));
}
}
else
{
throw new KettleException(BaseMessages.getString(PKG, "GPBulkLoaderMeta.Exception.TableNotSpecified"));
}
}
catch(Exception e)
{
throw new KettleException(BaseMessages.getString(PKG, "GPBulkLoaderMeta.Exception.ErrorGettingFields"), e);
}
finally
{
db.disconnect();
}
}
else
{
throw new KettleException(BaseMessages.getString(PKG, "GPBulkLoaderMeta.Exception.ConnectionNotDefined"));
}
}
示例8: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
{
String realTableName = space.environmentSubstitute(tableName);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta!=null)
{
Database db = new Database(databaseMeta);
try
{
db.connect();
if (!Const.isEmpty(realTableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable))
{
return db.getTableFields(schemaTable);
}
else
{
throw new KettleException(Messages.getString("LucidDBBulkLoaderMeta.Exception.TableNotFound"));
}
}
else
{
throw new KettleException(Messages.getString("LucidDBBulkLoaderMeta.Exception.TableNotSpecified"));
}
}
catch(Exception e)
{
throw new KettleException(Messages.getString("LucidDBBulkLoaderMeta.Exception.ErrorGettingFields"), e);
}
finally
{
db.disconnect();
}
}
else
{
throw new KettleException(Messages.getString("LucidDBBulkLoaderMeta.Exception.ConnectionNotDefined"));
}
}
示例9: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
{
String realSchemaName = space.environmentSubstitute(schemaName);
String realTableName = space.environmentSubstitute(tableName);
if (databaseMeta!=null)
{
Database db = new Database(databaseMeta);
try
{
db.connect();
if (!Const.isEmpty(realTableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable))
{
return db.getTableFields(schemaTable);
}
else
{
throw new KettleException(Messages.getString("InsertUpdateMeta.Exception.TableNotFound"));
}
}
else
{
throw new KettleException(Messages.getString("InsertUpdateMeta.Exception.TableNotSpecified"));
}
}
catch(Exception e)
{
throw new KettleException(Messages.getString("InsertUpdateMeta.Exception.ErrorGettingFields"), e);
}
finally
{
db.disconnect();
}
}
else
{
throw new KettleException(Messages.getString("InsertUpdateMeta.Exception.ConnectionNotDefined"));
}
}
示例10: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
{
String realTableName = space.environmentSubstitute(tablename);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta!=null)
{
Database db = new Database(databaseMeta);
try
{
db.connect();
if (!Const.isEmpty(realTableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable))
{
return db.getTableFields(schemaTable);
}
else
{
throw new KettleException(Messages.getString("TableOutputMeta.Exception.TableNotFound"));
}
}
else
{
throw new KettleException(Messages.getString("TableOutputMeta.Exception.TableNotSpecified"));
}
}
catch(Exception e)
{
throw new KettleException(Messages.getString("TableOutputMeta.Exception.ErrorGettingFields"), e);
}
finally
{
db.disconnect();
}
}
else
{
throw new KettleException(Messages.getString("TableOutputMeta.Exception.ConnectionNotDefined"));
}
}
示例11: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
{
String realTableName = space.environmentSubstitute(tableName);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta!=null)
{
Database db = new Database(databaseMeta);
try
{
db.connect();
if (!Const.isEmpty(realTableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable))
{
return db.getTableFields(schemaTable);
}
else
{
throw new KettleException(Messages.getString("GPBulkLoaderMeta.Exception.TableNotFound"));
}
}
else
{
throw new KettleException(Messages.getString("GPBulkLoaderMeta.Exception.TableNotSpecified"));
}
}
catch(Exception e)
{
throw new KettleException(Messages.getString("GPBulkLoaderMeta.Exception.ErrorGettingFields"), e);
}
finally
{
db.disconnect();
}
}
else
{
throw new KettleException(Messages.getString("GPBulkLoaderMeta.Exception.ConnectionNotDefined"));
}
}
示例12: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
{
String realTableName = space.environmentSubstitute(tableName);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta!=null)
{
Database db = new Database(databaseMeta);
try
{
db.connect();
if (!Const.isEmpty(realTableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable))
{
return db.getTableFields(schemaTable);
}
else
{
throw new KettleException(Messages.getString("GPBulkLoaderMeta.Exception.TableNotFound"));
}
}
else
{
throw new KettleException(Messages.getString("GPBulkLoaderMeta.Exception.TableNotSpecified"));
}
}
catch(Exception e)
{
throw new KettleException(Messages.getString("GPBulkLoaderMeta.Exception.ErrorGettingFields"), e);
}
finally
{
db.disconnect();
}
}
else
{
throw new KettleException(Messages.getString("GPBulkLoaderMeta.Exception.ConnectionNotDefined"));
}
}
示例13: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
{
String realTableName = space.environmentSubstitute(tableName);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta!=null)
{
Database db = new Database(databaseMeta);
try
{
db.connect();
if (!Const.isEmpty(realTableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable))
{
return db.getTableFields(schemaTable);
}
else
{
throw new KettleException(Messages.getString("MonetDBBulkLoaderMeta.Exception.TableNotFound"));
}
}
else
{
throw new KettleException(Messages.getString("MonetDBBulkLoaderMeta.Exception.TableNotSpecified"));
}
}
catch(Exception e)
{
throw new KettleException(Messages.getString("MonetDBBulkLoaderMeta.Exception.ErrorGettingFields"), e);
}
finally
{
db.disconnect();
}
}
else
{
throw new KettleException(Messages.getString("MonetDBBulkLoaderMeta.Exception.ConnectionNotDefined"));
}
}
示例14: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
{
String realTableName = space.environmentSubstitute(tableName);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta!=null)
{
Database db = new Database(databaseMeta);
try
{
db.connect();
if (!Const.isEmpty(realTableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable))
{
return db.getTableFields(schemaTable);
}
else
{
throw new KettleException(Messages.getString("SynchronizeAfterMergeMeta.Exception.TableNotFound"));
}
}
else
{
throw new KettleException(Messages.getString("SynchronizeAfterMergeMeta.Exception.TableNotSpecified"));
}
}
catch(Exception e)
{
throw new KettleException(Messages.getString("SynchronizeAfterMergeMeta.Exception.ErrorGettingFields"), e);
}
finally
{
db.disconnect();
}
}
else
{
throw new KettleException(Messages.getString("SynchronizeAfterMergeMeta.Exception.ConnectionNotDefined"));
}
}
示例15: getRequiredFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
{
String realTableName = space.environmentSubstitute(tableName);
String realSchemaName = space.environmentSubstitute(schemaName);
if (databaseMeta!=null)
{
Database db = new Database(loggingObject, databaseMeta);
try
{
db.connect();
if (!Const.isEmpty(realTableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(realSchemaName, realTableName);
// Check if this table exists...
if (db.checkTableExists(schemaTable))
{
return db.getTableFields(schemaTable);
}
else
{
throw new KettleException(BaseMessages.getString(PKG, "GPBulkLoaderMeta.Exception.TableNotFound"));
}
}
else
{
throw new KettleException(BaseMessages.getString(PKG, "GPBulkLoaderMeta.Exception.TableNotSpecified"));
}
}
catch(Exception e)
{
throw new KettleException(BaseMessages.getString(PKG, "GPBulkLoaderMeta.Exception.ErrorGettingFields"), e);
}
finally
{
db.disconnect();
}
}
else
{
throw new KettleException(BaseMessages.getString(PKG, "GPBulkLoaderMeta.Exception.ConnectionNotDefined"));
}
}