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


Java DatabaseMeta.getName方法代码示例

本文整理汇总了Java中org.pentaho.di.core.database.DatabaseMeta.getName方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseMeta.getName方法的具体用法?Java DatabaseMeta.getName怎么用?Java DatabaseMeta.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.core.database.DatabaseMeta的用法示例。


在下文中一共展示了DatabaseMeta.getName方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getData

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData()
{
    if (jobEntry.getName() != null)
        wName.setText(jobEntry.getName());
    if (jobEntry.getSQL() != null)
        wSQL.setText(jobEntry.getSQL());
    DatabaseMeta dbinfo = jobEntry.getDatabase();
    if (dbinfo != null && dbinfo.getName() != null)
        wConnection.setText(dbinfo.getName());
    else
        wConnection.setText("");

    wUseSubs.setSelection(jobEntry.getUseVariableSubstitution());
    wSQLFromFile.setSelection(jobEntry.getSQLFromFile());
    
    if (jobEntry.getSQLFilename() != null)
    	wFilename.setText(jobEntry.getSQLFilename());
    
    
    
    wName.selectAll();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:26,代码来源:JobEntrySQLDialog.java

示例2: getData

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData()
{
    if (jobEntry.getName() != null)
        wName.setText(jobEntry.getName());
    if (jobEntry.getSQL() != null)
        wSQL.setText(jobEntry.getSQL());
    DatabaseMeta dbinfo = jobEntry.getDatabase();
    if (dbinfo != null && dbinfo.getName() != null)
        wConnection.setText(dbinfo.getName());
    else
        wConnection.setText("");

    wUseSubs.setSelection(jobEntry.getUseVariableSubstitution());
    wSQLFromFile.setSelection(jobEntry.getSQLFromFile());
    wSendOneStatement.setSelection(jobEntry.isSendOneStatement());
    
    if (jobEntry.getSQLFilename() != null)
    	wFilename.setText(jobEntry.getSQLFilename());
    
    
    
    wName.selectAll();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:JobEntrySQLDialog.java

示例3: dupeConnection

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
public void dupeConnection(HasDatabasesInterface hasDatabasesInterface, DatabaseMeta databaseMeta)
{
	String name = databaseMeta.getName();
	int pos = hasDatabasesInterface.indexOfDatabase(databaseMeta);
	if (databaseMeta != null)
	{
		DatabaseMeta databaseMetaCopy = (DatabaseMeta) databaseMeta.clone();
		String dupename = BaseMessages.getString(PKG, "Spoon.Various.DupeName") + name;
		databaseMetaCopy.setName(dupename);

		getDatabaseDialog().setDatabaseMeta(databaseMetaCopy);
		
		String newname = getDatabaseDialog().open();
		if (newname != null) // null: CANCEL
		{
			databaseMetaCopy.verifyAndModifyDatabaseName(hasDatabasesInterface.getDatabases(), name);
			hasDatabasesInterface.addDatabase(pos + 1, databaseMetaCopy);
			spoon
					.addUndoNew((UndoInterface) hasDatabasesInterface,
							new DatabaseMeta[] { (DatabaseMeta) databaseMetaCopy.clone() },
							new int[] { pos + 1 });
			saveConnection(databaseMetaCopy, Const.VERSION_COMMENT_EDIT_VERSION);
			spoon.refreshTree();
		}
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:SpoonDBDelegate.java

示例4: readDatabases

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
public void readDatabases(Repository rep, boolean overWriteShared) throws KettleException {
	try {
		long dbids[] = rep.getDatabaseIDs();
		for (int i = 0; i < dbids.length; i++) {
			DatabaseMeta databaseMeta = RepositoryUtil.loadDatabaseMeta(rep, dbids[i]);
			databaseMeta.shareVariablesWith(this);

			DatabaseMeta check = findDatabase(databaseMeta.getName()); // Check
																		// if
																		// there
																		// already
																		// is
																		// one
																		// in
																		// the
			// transformation
			if (check == null || overWriteShared) // We only add, never
													// overwrite database
													// connections.
			{
				if (databaseMeta.getName() != null) {
					addOrReplaceDatabase(databaseMeta);
					if (!overWriteShared)
						databaseMeta.setChanged(false);
				}
			}
		}
		setChanged(false);
	} catch (KettleDatabaseException dbe) {
		throw new KettleException(Messages.getString("JobMeta.Log.UnableToReadDatabaseIDSFromRepository"), dbe); //$NON-NLS-1$
	} catch (KettleException ke) {
		throw new KettleException(Messages.getString("JobMeta.Log.UnableToReadDatabasesFromRepository"), ke); //$NON-NLS-1$
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:35,代码来源:JobMeta.java

示例5: readDatabases

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
public void readDatabases(Repository rep, boolean overWriteShared) throws KettleException
{
    try
    {
        long dbids[] = rep.getDatabaseIDs();
        for (int i = 0; i < dbids.length; i++)
        {
            DatabaseMeta databaseMeta = RepositoryUtil.loadDatabaseMeta(rep, dbids[i]);
            databaseMeta.shareVariablesWith(this);
            
            DatabaseMeta check = findDatabase(databaseMeta.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) // We only add, never overwrite database connections. 
            {
                if (databaseMeta.getName() != null)
                {
                    addOrReplaceDatabase(databaseMeta);
                    if (!overWriteShared) databaseMeta.setChanged(false);
                }
            }
        }
        changed_databases = false;
    }
    catch (KettleDatabaseException dbe)
    {
        throw new KettleException(Messages.getString("TransMeta.Log.UnableToReadDatabaseIDSFromRepository"), dbe); //$NON-NLS-1$
    }
    catch (KettleException ke)
    {
        throw new KettleException(Messages.getString("TransMeta.Log.UnableToReadDatabasesFromRepository"), ke); //$NON-NLS-1$
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:32,代码来源:TransMeta.java

示例6: dupeConnection

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
public void dupeConnection(HasDatabasesInterface hasDatabasesInterface, DatabaseMeta databaseMeta)
{
	String name = databaseMeta.getName();
	int pos = hasDatabasesInterface.indexOfDatabase(databaseMeta);
	if (databaseMeta != null)
	{
		DatabaseMeta databaseMetaCopy = (DatabaseMeta) databaseMeta.clone();
		String dupename = Messages.getString("Spoon.Various.DupeName") + name; // "(copy
		// of)
		// "
		databaseMetaCopy.setName(dupename);

		DatabaseDialog con = new DatabaseDialog(spoon.getShell(), databaseMetaCopy);
		String newname = con.open();
		if (newname != null) // null: CANCEL
		{
			databaseMetaCopy.verifyAndModifyDatabaseName(hasDatabasesInterface.getDatabases(), name);
			hasDatabasesInterface.addDatabase(pos + 1, databaseMetaCopy);
			spoon
					.addUndoNew((UndoInterface) hasDatabasesInterface,
							new DatabaseMeta[] { (DatabaseMeta) databaseMetaCopy.clone() },
							new int[] { pos + 1 });
			saveConnection(databaseMetaCopy);
			spoon.refreshTree();
		}
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:28,代码来源:SpoonDBDelegate.java

示例7: ClassicDatabaseDialog

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
public ClassicDatabaseDialog(Shell parent, DatabaseMeta databaseMeta)
{
    super(parent, SWT.NONE);
    this.databaseMeta = databaseMeta;
    this.databaseName = databaseMeta.getName();
    this.props = PropsUI.getInstance();
    this.databases = null;
    this.extraOptions = databaseMeta.getExtraOptions();
    this.database_id = databaseMeta.getID();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:11,代码来源:ClassicDatabaseDialog.java

示例8: readDatabases

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
/**
 * Read the database connections in the repository and add them to this job
 * if they are not yet present.
 * 
 * @param jobMeta the job to put the database connections in
 * @param overWriteShared set to true if you want to overwrite shared connections while loading.
 * @throws KettleException
 */
public void readDatabases(JobMeta jobMeta, boolean overWriteShared) throws KettleException {
	try {
		ObjectId dbids[] = repository.getDatabaseIDs(false);
		for (int i = 0; i < dbids.length; i++) {
			DatabaseMeta databaseMeta = repository.loadDatabaseMeta(dbids[i], null); // reads last version
			databaseMeta.shareVariablesWith(jobMeta);

			// See if there already is one in the transformation
			//
			DatabaseMeta check = jobMeta.findDatabase(databaseMeta.getName());
			
			// We only add, never overwrite database connections.
			//
			if (check == null || overWriteShared) 
			{
				if (databaseMeta.getName() != null) {
					jobMeta.addOrReplaceDatabase(databaseMeta);
					if (!overWriteShared)
						databaseMeta.setChanged(false);
				}
			}
		}
		jobMeta.setChanged(false);
	} catch (KettleDatabaseException dbe) {
		throw new KettleException(BaseMessages.getString(PKG, "JobMeta.Log.UnableToReadDatabaseIDSFromRepository"), dbe); //$NON-NLS-1$
	} catch (KettleException ke) {
		throw new KettleException(BaseMessages.getString(PKG, "JobMeta.Log.UnableToReadDatabasesFromRepository"), ke); //$NON-NLS-1$
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:38,代码来源:KettleDatabaseRepositoryJobDelegate.java

示例9: readDatabases

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
/**
 * Read all the databases from the repository, insert into the TransMeta object, overwriting optionally
 * 
 * @param TransMeta The transformation to load into.
 * @param overWriteShared if an object with the same name exists, overwrite
 * @throws KettleException 
 */
public void readDatabases(TransMeta transMeta, boolean overWriteShared) throws KettleException
{
    try
    {
        ObjectId dbids[] = repository.getDatabaseIDs(false);
        for (int i = 0; i < dbids.length; i++)
        {
            DatabaseMeta databaseMeta = repository.loadDatabaseMeta(dbids[i], null); // reads last version
            databaseMeta.shareVariablesWith(transMeta);
            
            DatabaseMeta check = transMeta.findDatabase(databaseMeta.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) // We only add, never overwrite database connections. 
            {
                if (databaseMeta.getName() != null)
                {
             	   transMeta.addOrReplaceDatabase(databaseMeta);
                    if (!overWriteShared) databaseMeta.setChanged(false);
                }
            }
        }
        transMeta.clearChangedDatabases();
    }
    catch (KettleDatabaseException dbe)
    {
        throw new KettleException(BaseMessages.getString(PKG, "TransMeta.Log.UnableToReadDatabaseIDSFromRepository"), dbe); //$NON-NLS-1$
    }
    catch (KettleException ke)
    {
        throw new KettleException(BaseMessages.getString(PKG, "TransMeta.Log.UnableToReadDatabasesFromRepository"), ke); //$NON-NLS-1$
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:39,代码来源:KettleDatabaseRepositoryTransDelegate.java

示例10: readDatabases

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
/**
 * Read all the databases from the repository, insert into the has databases object, overwriting optionally
 * 
 * @param TransMeta The transformation to load into.
 * @param overWriteShared if an object with the same name exists, overwrite
 * @throws KettleException 
 */
public void readDatabases(HasDatabasesInterface transMeta, boolean overWriteShared) throws KettleException
{
    try
    {
        ObjectId dbids[] = getDatabaseIDs(false);
        for (int i = 0; i < dbids.length; i++)
        {
            DatabaseMeta databaseMeta = loadDatabaseMeta(dbids[i], null); // reads last version
            if (transMeta instanceof VariableSpace) {
              databaseMeta.shareVariablesWith((VariableSpace)transMeta);
            }
            
            DatabaseMeta check = transMeta.findDatabase(databaseMeta.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) // We only add, never overwrite database connections. 
            {
                if (databaseMeta.getName() != null)
                {
                  transMeta.addOrReplaceDatabase(databaseMeta);
                    if (!overWriteShared) databaseMeta.setChanged(false);
                }
            }
        }
    }
    catch (KettleException e)
    {
        throw e;
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:36,代码来源:KettleFileRepository.java

示例11: getFromDatabaseMeta

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
public static SAPConnectionParams getFromDatabaseMeta(DatabaseMeta sapConnection) {
	String name = sapConnection.getName();
	String host = sapConnection.getHostname();
	String sysnr = sapConnection.getAttributes().getProperty(
			"SAPSystemNumber");
	String client = sapConnection.getAttributes().getProperty("SAPClient");
	String user = sapConnection.getUsername();
	String password = sapConnection.getPassword();
	String lang = "";
	return new SAPConnectionParams(name, host, sysnr, client, user,
			password, lang);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:13,代码来源:SAPConnectionParamsHelper.java

示例12: addDatabases

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
public void addDatabases() {
connections = new String[jobMeta.nrDatabases()];
   for (int i = 0; i < jobMeta.nrDatabases(); i++) {
     DatabaseMeta ci = jobMeta.getDatabase(i);
   	  connections[i]=ci.getName();
   }
 }
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:8,代码来源:JobEntryCheckDbConnectionsDialog.java


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