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


Java KettleDatabaseException类代码示例

本文整理汇总了Java中org.pentaho.di.core.exception.KettleDatabaseException的典型用法代码示例。如果您正苦于以下问题:Java KettleDatabaseException类的具体用法?Java KettleDatabaseException怎么用?Java KettleDatabaseException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


KettleDatabaseException类属于org.pentaho.di.core.exception包,在下文中一共展示了KettleDatabaseException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveRep

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {
  try {
    rep.saveDatabaseMetaJobEntryAttribute( id_job, getObjectId(), CONNECTION, "id_database", databaseMeta );
    rep.saveJobEntryAttribute( id_job, getObjectId(), MANAGEMENT_ACTION, getManagementAction() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), REPLACE, isReplace() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), FAIL_IF_EXISTS, isFailIfExists() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), WAREHOUSE_NAME, getWarehouseName() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), WAREHOUSE_SIZE, getWarehouseSize() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), WAREHOUSE_TYPE, getWarehouseType() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), MAX_CLUSTER_COUNT, getMaxClusterCount() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), MIN_CLUSTER_COUNT, getMinClusterCount() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), AUTO_SUSPEND, getAutoSuspend() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), AUTO_RESUME, isAutoResume() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), INITIALLY_SUSPENDED, isInitiallySuspended() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), RESOURCE_MONITOR, getResourceMonitor() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), COMMENT, getComment() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), FAIL_IF_NOT_EXISTS, isFailIfNotExists() );
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleDatabaseException( BaseMessages.getString( PKG, "SnowflakeWarehouseManager.Error.Exception.UnableSaveRep" )
      + getObjectId(), dbe );
  }
}
 
开发者ID:inquidia,项目名称:PentahoSnowflakePlugin,代码行数:23,代码来源:WarehouseManager.java

示例2: saveRep

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
public void saveRep(Repository rep, long id_job) throws KettleException
{
  try
  {
    super.saveRep(rep, id_job);

    rep.saveJobEntryAttribute(id_job, getID(), "filename", filename);
    rep.saveJobEntryAttribute(id_job, getID(), "fail_if_file_exists", failIfFileExists);
    rep.saveJobEntryAttribute(id_job, getID(), "add_filename_result", addfilenameresult);
    
  } catch (KettleDatabaseException dbe)
  {
    throw new KettleException(
        "Unable to save job entry of type 'create file' to the repository for id_job=" + id_job, dbe);
  }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:JobEntryCreateFile.java

示例3: getTableFields

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
public RowMetaInterface getTableFields()
{
	LogWriter log = LogWriter.getInstance();
       
	RowMetaInterface fields = null;
	if (databaseMeta != null)
	{
		Database db = new Database(databaseMeta);
		try
		{
			db.connect();
			fields = db.getTableFields(databaseMeta.getQuotedSchemaTableCombination(schemaName, tableName));
		}
		catch (KettleDatabaseException dbe)
		{
			log.logError(toString(), Messages.getString("DimensionLookupMeta.Log.DatabaseErrorOccurred") + dbe.getMessage()); //$NON-NLS-1$
		}
		finally
		{
			db.disconnect();
		}
	}
	return fields;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:25,代码来源:DimensionLookupMeta.java

示例4: setValues

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
public void setValues(String name, String type, String access, String host, String db, String port, String user, String pass)
{
	try
	{
		databaseInterface = getDatabaseInterface(type);
	}
	catch(KettleDatabaseException kde)
	{
		throw new RuntimeException("Database type not found!", kde);
	}
	
	setName(name);
	setAccessType(getAccessType(access));
	setHostname(host);
	setDBName(db);
	setDBPort(port);
	setUsername(user);
	setPassword(pass);
	setServername(null);
	setChanged(false);
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:22,代码来源:DatabaseMeta.java

示例5: setDatabaseType

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
public void setDatabaseType(String type)
{
	DatabaseInterface oldInterface = databaseInterface;
	
	try
	{
		databaseInterface = getDatabaseInterface(type);
	}
	catch(KettleDatabaseException kde)
	{
		throw new RuntimeException("Database type ["+type+"] not found!", kde);
	}
	
	setName(oldInterface.getName());
	setAccessType(oldInterface.getAccessType());
	setHostname(oldInterface.getHostname());
	setDBName(oldInterface.getDatabaseName());
	setDBPort(oldInterface.getDatabasePortNumberString());
	setUsername(oldInterface.getUsername());
	setPassword(oldInterface.getPassword());
	setServername(oldInterface.getServername());
	setDataTablespace(oldInterface.getDataTablespace());
	setIndexTablespace(oldInterface.getIndexTablespace());
	setChanged(oldInterface.isChanged());
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:26,代码来源:DatabaseMeta.java

示例6: getInputData

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
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); //$NON-NLS-1$ //$NON-NLS-2$
		input = null;
		return false;
	}
	finally
	{
		sourceDb.disconnect();
	}
	return true;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:24,代码来源:CopyTableWizardPage2.java

示例7: getViews

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
public String[] getViews(String schemanamein, boolean includeSchema) throws KettleDatabaseException
{
  Map<String, Collection<String>> viewMap = getViewMap(schemanamein);
  List<String> res = new ArrayList<String>();
  for (String schema : viewMap.keySet())
  {
    Collection<String> views = viewMap.get(schema);
    for (String view : views)
    if (includeSchema)
    {
      res.add(databaseMeta.getQuotedSchemaTableCombination(schema, view));
    }
    else
    {
      res.add(view);
    }
  }
   return res.toArray(new String[res.size()]);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:20,代码来源:Database.java

示例8: connect

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
/**
 * Connect to the repository. 
 * 
 * @throws KettleSecurityException in case the supplied user or password is not valid
 * @throws KettleException in case there is a general unexpected error or if we're already connected
 */
public void connect(String username, String password, boolean upgrade) throws KettleException {
  // first disconnect if already connected
  connectionDelegate.connect(upgrade, upgrade);
	try {
	  IUser userinfo = userDelegate.loadUserInfo(new UserInfo(), username, password);
	  securityProvider = new KettleDatabaseRepositorySecurityProvider(this, repositoryMeta, userinfo);
    
    // We need to add services in the list in the order of dependencies
	  registerRepositoryService(RepositorySecurityProvider.class, securityProvider);
	  registerRepositoryService(RepositorySecurityManager.class, securityProvider);
	} catch (KettleDatabaseException e) {
	  // if we fail to log in, disconnect and then rethrow the exception
	  connectionDelegate.disconnect();
	  throw e;
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:KettleDatabaseRepository.java

示例9: closeInsert

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
public void closeInsert() throws KettleDatabaseException

	{
		if (prepStatementInsert!=null)
		{
			try 
			{
				prepStatementInsert.close();
				prepStatementInsert = null;
			}
			catch(SQLException e)
			{
				throw new KettleDatabaseException("Error closing insert prepared statement.", e);
			}
		}
	}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:Database.java

示例10: unlockTables

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
/**
 * Unlock certain tables in the database for write operations
 * @param tableNames The tables to unlock
 * @throws KettleDatabaseException
 */
public void unlockTables(String tableNames[]) throws KettleDatabaseException
{
	if (Const.isEmpty(tableNames)) return;
	
	// Quote table names too...
	//
	String[] quotedTableNames = new String[tableNames.length];
	for (int i=0;i<tableNames.length;i++) quotedTableNames[i] = databaseMeta.getQuotedSchemaTableCombination(null, tableNames[i]);
	
	// Get the SQL to unlock the (quoted) tables
	//
    String sql = databaseMeta.getSQLUnlockTables(quotedTableNames);
    if (sql!=null)
    {
        execStatement(sql);
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:23,代码来源:Database.java

示例11: saveRep

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
public void saveRep(Repository rep, long id_job)
	throws KettleException
{
	try
	{
		super.saveRep(rep, id_job);

		rep.saveJobEntryAttribute(id_job, getID(), "xmlfilename", xmlfilename);
		rep.saveJobEntryAttribute(id_job, getID(), "xslfilename", xslfilename);
		rep.saveJobEntryAttribute(id_job, getID(), "outputfilename", outputfilename);
		rep.saveJobEntryAttribute(id_job, getID(), "iffileexists", iffileexists);
		rep.saveJobEntryAttribute(id_job, getID(), "addfiletoresult", addfiletoresult);
		rep.saveJobEntryAttribute(id_job, getID(), "xsltfactory", xsltfactory);
		
	}
	catch(KettleDatabaseException dbe)
	{
		throw new KettleException("Unable to save job entry of type 'xslt' to the repository for id_job="+id_job, dbe);
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:21,代码来源:JobEntryXSLT.java

示例12: saveRep

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
public void saveRep(Repository rep, ObjectId id_job) throws KettleException
{
	try
	{
		rep.saveJobEntryAttribute(id_job, getObjectId(), "port",      port);
		rep.saveJobEntryAttribute(id_job, getObjectId(), "servername",      serverName);
		rep.saveJobEntryAttribute(id_job, getObjectId(), "oid",      oid);
		rep.saveJobEntryAttribute(id_job, getObjectId(), "message",      message);
		rep.saveJobEntryAttribute(id_job, getObjectId(), "comstring",      comString);
		rep.saveJobEntryAttribute(id_job, getObjectId(), "timeout",         timeout);
		rep.saveJobEntryAttribute(id_job, getObjectId(), "nrretry",         nrretry);
		rep.saveJobEntryAttribute(id_job, getObjectId(), "targettype",         targettype);
		rep.saveJobEntryAttribute(id_job, getObjectId(), "user",         user);
		rep.saveJobEntryAttribute(id_job, getObjectId(), "passphrase",         passphrase);
		rep.saveJobEntryAttribute(id_job, getObjectId(), "engineid",         engineid);
          
	}
	catch(KettleDatabaseException dbe)
	{
		throw new KettleException("Unable to save job entry of type 'SNMPTrap' to the repository for id_job="+id_job, dbe);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:JobEntrySNMPTrap.java

示例13: loadRep

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
public void loadRep(Repository rep, long id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers)
	throws KettleException
{
	try
	{
		super.loadRep(rep, id_jobentry, databases, slaveServers);
		isspecificrep = rep.getJobEntryAttributeBoolean(id_jobentry, "isspecificrep"); 
		repname = rep.getJobEntryAttributeString(id_jobentry, "repname"); 
		isspecificuser = rep.getJobEntryAttributeBoolean(id_jobentry, "isspecificuser"); 
		username = rep.getJobEntryAttributeString(id_jobentry, "username"); 
		
	}
	catch(KettleDatabaseException dbe)
	{
		throw new KettleException(Messages.getString("JobEntryConnectedToRepository.Meta.UnableToLoadFromRep")+id_jobentry, dbe);


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

示例14: getFirstRows

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
/**
    * Get the first rows from a table (for preview) 
    * @param table_name The table name (or schema/table combination): this needs to be quoted properly
    * @param limit limit <=0 means unlimited, otherwise this specifies the maximum number of rows read.
    * @param monitor The progress monitor to update while getting the rows.
    * @return An ArrayList of rows.
    * @throws KettleDatabaseException in case something goes wrong
    */
public List<Object[]> getFirstRows(String table_name, int limit, ProgressMonitorListener monitor) throws KettleDatabaseException
{
	String sql = "SELECT";
	if (databaseMeta.getDatabaseInterface() instanceof NeoviewDatabaseMeta)
	{
		sql+=" [FIRST " + limit +"]";
	}
	else if (databaseMeta.getDatabaseInterface() instanceof SybaseIQDatabaseMeta)  // improve support Sybase IQ
	{
		sql+=" TOP " + limit +" ";
	}
	sql += " * FROM "+table_name;
	
       if (limit>0)
	{
	    sql+=databaseMeta.getLimitClause(limit);
	}
	
	return getRows(sql, limit, monitor);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:29,代码来源:Database.java

示例15: readSlaves

import org.pentaho.di.core.exception.KettleDatabaseException; //导入依赖的package包/类
/**
 * Read the slave servers in the repository and add them to this transformation if they are not yet present.
 * @param rep The repository to load from.
 * @param overWriteShared if an object with the same name exists, overwrite
 * @throws KettleException 
 */
public void readSlaves(Repository rep, boolean overWriteShared) throws KettleException
{
    try
    {
        long dbids[] = rep.getSlaveIDs();
        for (int i = 0; i < dbids.length; i++)
        {
            SlaveServer slaveServer = new SlaveServer(rep, dbids[i]);
            slaveServer.shareVariablesWith(this);
            SlaveServer check = findSlaveServer(slaveServer.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) 
            {
                if (!Const.isEmpty(slaveServer.getName()))
                {
                    addOrReplaceSlaveServer(slaveServer);
                    if (!overWriteShared) slaveServer.setChanged(false);
                }
            }
        }
    }
    catch (KettleDatabaseException dbe)
    {
        throw new KettleException(Messages.getString("TransMeta.Log.UnableToReadSlaveServersFromRepository"), dbe); //$NON-NLS-1$
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:32,代码来源:TransMeta.java


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