本文整理汇总了Java中org.pentaho.di.core.database.Database.getQueryFields方法的典型用法代码示例。如果您正苦于以下问题:Java Database.getQueryFields方法的具体用法?Java Database.getQueryFields怎么用?Java Database.getQueryFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.database.Database
的用法示例。
在下文中一共展示了Database.getQueryFields方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTableFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getTableFields()
{
LogWriter log = LogWriter.getInstance();
// Build a dummy parameter row...
//
RowMetaInterface param = new RowMeta();
for (int i=0;i<parameterField.length;i++)
{
param.addValueMeta( new ValueMeta(parameterField[i], parameterType[i]) );
}
RowMetaInterface fields = null;
if (databaseMeta!=null)
{
Database db = new Database(databaseMeta);
databases = new Database[] { db }; // Keep track of this one for cancelQuery
try
{
db.connect();
fields = db.getQueryFields(sql, true, param, new Object[param.size()]);
}
catch(KettleDatabaseException dbe)
{
log.logError(toString(), Messages.getString("DatabaseJoinMeta.Log.DatabaseErrorOccurred")+dbe.getMessage()); //$NON-NLS-1$
}
finally
{
db.disconnect();
}
}
return fields;
}
示例2: getTableFields
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public RowMetaInterface getTableFields()
{
// Build a dummy parameter row...
//
RowMetaInterface param = new RowMeta();
for (int i=0;i<parameterField.length;i++)
{
param.addValueMeta( new ValueMeta(parameterField[i], parameterType[i]) );
}
RowMetaInterface fields = null;
if (databaseMeta!=null)
{
Database db = new Database(loggingObject, databaseMeta);
databases = new Database[] { db }; // Keep track of this one for cancelQuery
try
{
db.connect();
fields = db.getQueryFields(databaseMeta.environmentSubstitute(sql), true, param, new Object[param.size()]);
}
catch(KettleDatabaseException dbe)
{
logError(BaseMessages.getString(PKG, "DatabaseJoinMeta.Log.DatabaseErrorOccurred")+dbe.getMessage()); //$NON-NLS-1$
}
finally
{
db.disconnect();
}
}
return fields;
}