use of com.helger.db.jdbc.executor.DBResultRow in project phoss-smp by phax.
the class SMPParticipantMigrationManagerJDBC method getParticipantMigrationOfParticipantID.
@Nullable
public ISMPParticipantMigration getParticipantMigrationOfParticipantID(@Nonnull final EParticipantMigrationDirection eDirection, @Nonnull final EParticipantMigrationState eState, @Nullable final IParticipantIdentifier aParticipantID) {
ValueEnforcer.notNull(eDirection, "Direction");
ValueEnforcer.notNull(eState, "State");
if (aParticipantID == null)
return null;
final Wrapper<DBResultRow> aDBResult = new Wrapper<>();
newExecutor().querySingle("SELECT id, initdt, migkey FROM smp_pmigration WHERE direction=? AND state=? AND pid=?", new ConstantPreparedStatementDataProvider(eDirection.getID(), eState.getID(), aParticipantID.getURIEncoded()), aDBResult::set);
if (aDBResult.isNotSet())
return null;
final DBResultRow aRow = aDBResult.get();
return new SMPParticipantMigration(aRow.getAsString(0), eDirection, eState, aParticipantID, aRow.getAsLocalDateTime(1), aRow.getAsString(2));
}
use of com.helger.db.jdbc.executor.DBResultRow in project phoss-smp by phax.
the class SMPSettingsManagerJDBC method getSettingsValue.
@Nullable
public static String getSettingsValue(@Nonnull final DBExecutor aExecutor, @Nullable final String sKey) {
if (StringHelper.hasNoText(sKey))
return null;
final Wrapper<DBResultRow> aDBResult = new Wrapper<>();
aExecutor.querySingle("SELECT value FROM smp_settings WHERE id=?", new ConstantPreparedStatementDataProvider(sKey), aDBResult::set);
if (aDBResult.isNotSet())
return null;
return aDBResult.get().getAsString(0);
}
Aggregations