All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xillium.data.persistence.SingleValueRetriever Maven / Gradle / Ivy

There is a newer version: 1.2.2
Show newest version
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