use of org.springframework.jdbc.core.RowCallbackHandler in project spring-cloud-task by spring-cloud.
the class JdbcTaskExecutionDao method getTaskArguments.
private List<String> getTaskArguments(long taskExecutionId) {
final List<String> params = new ArrayList<>();
RowCallbackHandler handler = new RowCallbackHandler() {
@Override
public void processRow(ResultSet rs) throws SQLException {
params.add(rs.getString(2));
}
};
this.jdbcTemplate.query(getQuery(FIND_ARGUMENT_FROM_ID), new MapSqlParameterSource("taskExecutionId", taskExecutionId), handler);
return params;
}
use of org.springframework.jdbc.core.RowCallbackHandler in project fcrepo by fcrepo.
the class MembershipIndexManager method logMembership.
/**
* Log all membership entries, for debugging usage only
*/
protected void logMembership() {
log.info("source_id, proxy_id, subject_id, property, object_id, start_time, end_time, last_updated");
jdbcTemplate.query(SELECT_ALL_MEMBERSHIP, new RowCallbackHandler() {
@Override
public void processRow(final ResultSet rs) throws SQLException {
log.info("{}, {}, {}, {}, {}, {}, {}, {}", rs.getString("source_id"), rs.getString("proxy_id"), rs.getString("subject_id"), rs.getString("property"), rs.getString("object_id"), rs.getTimestamp("start_time"), rs.getTimestamp("end_time"), rs.getTimestamp("last_updated"));
}
});
}
use of org.springframework.jdbc.core.RowCallbackHandler in project biosamples-v4 by EBIBioSamples.
the class TestConversion method test_with_failing.
@Test
public void test_with_failing() {
RowCallbackHandler rowCallbackHandler = resultSet -> {
String sampleAccession = resultSet.getString("BIOSAMPLE_ID");
EnaCallable enaCallable = new EnaCallable(sampleAccession, null, 0, bioSamplesWebinClient, enaXmlEnhancer, enaElementConverter, egaSampleExporter, eraProDao, false, false, null);
try {
enaCallable.call();
} catch (Exception e) {
e.printStackTrace();
fail();
}
};
eraProDao.getSingleSample("SAMEA104371999", rowCallbackHandler);
}
use of org.springframework.jdbc.core.RowCallbackHandler in project biosamples-v4 by EBIBioSamples.
the class TestConversion method test_over_all_samples.
@Test
@Ignore
public void test_over_all_samples() {
RowCallbackHandler rowCallbackHandler = resultSet -> {
String sampleAccession = resultSet.getString("BIOSAMPLE_ID");
EnaCallable enaCallable = new EnaCallable(sampleAccession, null, 0, bioSamplesWebinClient, enaXmlEnhancer, enaElementConverter, egaSampleExporter, eraProDao, false, false, null);
try {
enaCallable.call();
} catch (Exception e) {
e.printStackTrace();
}
};
LocalDate fromDate = LocalDate.parse("1000-01-01", DateTimeFormatter.ISO_LOCAL_DATE);
LocalDate toDate = LocalDate.parse("3000-01-01", DateTimeFormatter.ISO_LOCAL_DATE);
eraProDao.doSampleCallback(fromDate, toDate, rowCallbackHandler);
}
use of org.springframework.jdbc.core.RowCallbackHandler in project biosamples-v4 by EBIBioSamples.
the class TestConversion method test_with_killed.
@Test
public void test_with_killed() {
RowCallbackHandler rowCallbackHandler = resultSet -> {
String sampleAccession = resultSet.getString("BIOSAMPLE_ID");
EnaCallable enaCallable = new EnaCallable(sampleAccession, null, 0, bioSamplesWebinClient, enaXmlEnhancer, enaElementConverter, egaSampleExporter, eraProDao, false, false, null);
try {
enaCallable.call();
} catch (Exception e) {
e.printStackTrace();
fail();
}
};
eraProDao.getSingleSample("SAMEA1935107", rowCallbackHandler);
}
Aggregations