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

org.sfm.jdbc.getter.ByteNamedResultSetGetter Maven / Gradle / Ivy

package org.sfm.jdbc.getter;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.sfm.reflect.Getter;
import org.sfm.reflect.primitive.ByteGetter;

public final class ByteNamedResultSetGetter implements ByteGetter, Getter {

	private final String column;
	
	public ByteNamedResultSetGetter(final String column) {
		this.column = column;
	}

	@Override
	public byte getByte(final ResultSet target) throws SQLException {
		return target.getByte(column);
	}

	@Override
	public Byte get(final ResultSet target) throws Exception {
		final byte b = getByte(target);
		if (target.wasNull()) {
			return null;
		} else {
			return Byte.valueOf(b);
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy