
org.xillium.data.persistence.SingleValueRetriever Maven / Gradle / Ivy
package org.xillium.data.persistence;
import java.sql.*;
/**
* A ResultSetWorker implementation that returns the first colum of the first row as a single object.
*/
public class SingleValueRetriever implements ResultSetWorker {
@SuppressWarnings("unchecked")
public T process(ResultSet rs) throws Exception {
if (rs.next()) {
return (T)rs.getObject(1);
} else {
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy