當前位置: 首頁>>代碼示例>>Java>>正文


Java DatabaseMeta.getObjectId方法代碼示例

本文整理匯總了Java中org.pentaho.di.core.database.DatabaseMeta.getObjectId方法的典型用法代碼示例。如果您正苦於以下問題:Java DatabaseMeta.getObjectId方法的具體用法?Java DatabaseMeta.getObjectId怎麽用?Java DatabaseMeta.getObjectId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.pentaho.di.core.database.DatabaseMeta的用法示例。


在下文中一共展示了DatabaseMeta.getObjectId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: saveDatabaseMetaStepAttribute

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
/**
 * This method saves the object ID of the database object (if not null) in the step attributes
 * @param id_transformation
 * @param id_step
 * @param string
 * @param database
 */
public void saveDatabaseMetaStepAttribute(ObjectId id_transformation, ObjectId id_step, String code, DatabaseMeta database) throws KettleException {
	ObjectId id = null;
	if (database!=null) {
		id = database.getObjectId();
		Long id_database = id==null ? Long.valueOf(-1L) : new LongObjectId(id).longValue();
		saveStepAttribute(id_transformation, id_step, code, id_database);
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:16,代碼來源:KettleDatabaseRepository.java

示例2: saveDatabaseMetaJobEntryAttribute

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
/**
 * This method saves the object ID of the database object (if not null) in the step attributes
 * @param id_transformation
 * @param id_step
 * @param linkCode
 * @param nameCode
 * @param idCode
 * @param database
 */
public void saveDatabaseMetaJobEntryAttribute(ObjectId id_job, ObjectId id_jobentry, String nameCode, String idCode, DatabaseMeta database) throws KettleException {
	ObjectId id = null;
	if (database!=null) {
		id = database.getObjectId();
		Long id_database = id==null ? Long.valueOf(-1L) : new LongObjectId(id).longValue();
		
		// Save both the ID and the name of the database connection...
		//
		saveJobEntryAttribute(id_job, id_jobentry, idCode, id_database);
		saveJobEntryAttribute(id_job, id_jobentry, nameCode, id_database);
		
		insertJobEntryDatabase(id_job, id_jobentry, id);
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:24,代碼來源:KettleDatabaseRepository.java

示例3: setDatabaseMeta

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
public void setDatabaseMeta(DatabaseMeta dbMeta){
  databaseMeta = dbMeta;
  databaseMetaObjectId = dbMeta.getObjectId();
  if (dbMeta != null) {
    databaseName = databaseMeta.getName();
  }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:8,代碼來源:XulDatabaseDialog.java

示例4: saveDatabaseMeta

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
/**
 * Saves the database information into a given repository.
 * 
 * @param databaseMeta The database metadata object to store
 * 
 * @throws KettleException if an error occurs.
 */
public void saveDatabaseMeta(DatabaseMeta databaseMeta) throws KettleException
{
	try
	{
           // If we don't have an ID, we don't know which entry in the database we need to update.
		// See if a database with the same name is already available...
		if (databaseMeta.getObjectId()==null)
		{
			databaseMeta.setObjectId(getDatabaseID(databaseMeta.getName()));
		}
		
		// Still not found? --> Insert
		if (databaseMeta.getObjectId()==null)
		{
			// Insert new Note in repository
			//
			databaseMeta.setObjectId(insertDatabase(databaseMeta.getName(), 
										databaseMeta.getPluginId(), 
										DatabaseMeta.getAccessTypeDesc(databaseMeta.getAccessType()), 
										databaseMeta.getHostname(), 
										databaseMeta.getDatabaseName(), 
										databaseMeta.getDatabasePortNumberString(), 
										databaseMeta.getUsername(), 
										databaseMeta.getPassword(),
										databaseMeta.getServername(),
										databaseMeta.getDataTablespace(),
										databaseMeta.getIndexTablespace()
									)
				); 
		}
		else // --> found entry with the same name...
		{
			// Update the note...
			updateDatabase(	databaseMeta.getObjectId(),
					databaseMeta.getName(), 
										databaseMeta.getPluginId(), 
										DatabaseMeta.getAccessTypeDesc(databaseMeta.getAccessType()), 
										databaseMeta.getHostname(), 
										databaseMeta.getDatabaseName(), 
										databaseMeta.getDatabasePortNumberString(), 
										databaseMeta.getUsername(), 
										databaseMeta.getPassword(),
										databaseMeta.getServername(),
										databaseMeta.getDataTablespace(),
										databaseMeta.getIndexTablespace()
									);
		}
           
           // For the extra attributes, just delete them and re-add them.
           delDatabaseAttributes(databaseMeta.getObjectId());
           
           // OK, now get a list of all the attributes set on the database connection...
           // 
           Properties attributes = databaseMeta.getAttributes();
           Enumeration<Object> keys = databaseMeta.getAttributes().keys();
           while (keys.hasMoreElements())
           {
               String code = (String) keys.nextElement();
               String attribute = (String)attributes.get(code);
               
               // Save this attribute
               //
               insertDatabaseAttribute(databaseMeta.getObjectId(), code, attribute);
           }
	}
	catch(KettleDatabaseException dbe)
	{
		throw new KettleException("Error saving database connection or one of its attributes to the repository.", dbe);
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:78,代碼來源:KettleDatabaseRepositoryDatabaseDelegate.java


注:本文中的org.pentaho.di.core.database.DatabaseMeta.getObjectId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。