Generic DB Value Getter
Using polymorphism is the way to get an great solution. You are receiving the class in your method just to infer the the return type while you could abstract the idea of conversion and use it to do the inference too. Let's create an interface to convert the result and its implementations:

interface ResultTransformer&lt;T&gt; {
    T transform(ResultSet rs, String column) throws SQLException;
}

public class IntegerResultTransformer implements ResultTransformer&lt;Integer&gt; {
    public Integer transform(ResultSet rs, String column) throws SQLException {
        return rs.getInt(column);
    }
}

public class StringResultTransformer implements ResultTransformer&lt;String&gt; {
    public String transform(ResultSet rs, String column) throws SQLException {
        return rs.getString(column);
    }
}

public class DoubleResultTransformer implements ResultTransformer&lt;Double&gt; {
    public Double transform(ResultSet rs, String column) throws SQLException {
        return rs.getDouble(column);
    }
}


Now the method will receive a ResultTransformer and just call its method transform:

public &lt;T&gt; T getValueFromDb2(String col, String table, String cond, ResultTransformer&lt;T&gt; transformer) {
    // concatenate strings isn't a good idea, 
    // use the PreparedStatement methods: setString, setDouble and so on
    ResultSet rs = getSet("SELECT " + col + " FROM " + table + " WHERE " + cond);
    try {
        return transformer.transform(rs, col);
    } catch (SQLException e) {
        throw new RuntimeException(e); // don't return null
    }
}


Using the method:

Integer anInteger = getValueFromDb2("col", "table", "cond", new IntegerResultTransformer());
String aString = .getValueFromDb2("col", "table", "cond", new StringResultTransformer());
Double aDouble = .getValueFromDb2("col", "table", "cond", new DoubleResultTransformer());


For now on, you just need to create a new ResultTransform implementation.