当前位置: 首页>>代码示例>>Java>>正文


Java Database.checkTableExists方法代码示例

本文整理汇总了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" ) );
  }

}
 
开发者ID:inquidia,项目名称:PentahoSnowflakePlugin,代码行数:39,代码来源:SnowflakeBulkLoaderMeta.java

示例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"));
	}

}
 
开发者ID:jbleuel,项目名称:pdi-teradata-tpt-plugin,代码行数:32,代码来源:TeraDataBulkLoaderMeta.java

示例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"));
  }

}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:38,代码来源:LucidDBStreamingLoaderMeta.java

示例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"));
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:31,代码来源:SQLFileOutputMeta.java

示例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"));
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:31,代码来源:SQLFileOutputMeta.java

示例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"));
      }

  }
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:47,代码来源:SynchronizeAfterMergeMeta.java

示例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"));
    }

}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:47,代码来源:GPBulkLoaderMeta.java

示例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"));
    }

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:47,代码来源:LucidDBBulkLoaderMeta.java

示例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"));
    }

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:47,代码来源:InsertUpdateMeta.java

示例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"));
    }

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:47,代码来源:TableOutputMeta.java

示例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"));
    }

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:47,代码来源:PGBulkLoaderMeta.java

示例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"));
    }

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:47,代码来源:GPBulkLoaderMeta.java

示例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"));
    }

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:47,代码来源:MonetDBBulkLoaderMeta.java

示例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"));
      }

  }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:47,代码来源:SynchronizeAfterMergeMeta.java

示例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"));
    }

}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:47,代码来源:PGBulkLoaderMeta.java


注:本文中的org.pentaho.di.core.database.Database.checkTableExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。