本文整理汇总了Java中org.pentaho.di.core.database.Database.getCreateSequenceStatement方法的典型用法代码示例。如果您正苦于以下问题:Java Database.getCreateSequenceStatement方法的具体用法?Java Database.getCreateSequenceStatement怎么用?Java Database.getCreateSequenceStatement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.database.Database
的用法示例。
在下文中一共展示了Database.getCreateSequenceStatement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSQLStatements
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev)
{
SQLStatement retval = new SQLStatement(stepMeta.getName(), database, null); // default: nothing to do!
if (useDatabase) // Otherwise, don't bother!
{
if (database!=null)
{
Database db = new Database(database);
db.shareVariablesWith(transMeta);
try
{
db.connect();
if (!db.checkSequenceExists(schemaName, sequenceName))
{
String cr_table = db.getCreateSequenceStatement(sequenceName, startAt, incrementBy, maxValue, true);
retval.setSQL(cr_table);
}
else
{
retval.setSQL(null); // Empty string means: nothing to do: set it to null...
}
}
catch(KettleException e)
{
retval.setError(Messages.getString("AddSequenceMeta.ErrorMessage.UnableToConnectDB")+Const.CR+e.getMessage()); //$NON-NLS-1$
}
finally
{
db.disconnect();
}
}
else
{
retval.setError(Messages.getString("AddSequenceMeta.ErrorMessage.NoConnectionDefined")); //$NON-NLS-1$
}
}
return retval;
}
示例2: getSQLStatements
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
public SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev)
{
SQLStatement retval = new SQLStatement(stepMeta.getName(), database, null); // default: nothing to do!
if (useDatabase) // Otherwise, don't bother!
{
if (database!=null)
{
Database db = new Database(loggingObject, database);
db.shareVariablesWith(transMeta);
try
{
db.connect();
if (!db.checkSequenceExists(schemaName, sequenceName))
{
String cr_table = db.getCreateSequenceStatement(sequenceName, startAt, incrementBy, maxValue, true);
retval.setSQL(cr_table);
}
else
{
retval.setSQL(null); // Empty string means: nothing to do: set it to null...
}
}
catch(KettleException e)
{
retval.setError(BaseMessages.getString(PKG, "AddSequenceMeta.ErrorMessage.UnableToConnectDB")+Const.CR+e.getMessage()); //$NON-NLS-1$
}
finally
{
db.disconnect();
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "AddSequenceMeta.ErrorMessage.NoConnectionDefined")); //$NON-NLS-1$
}
}
return retval;
}