Java Utililty Methods SQL ResultSet Float Read

List of utility methods to do SQL ResultSet Float Read

  1. HOME
  2. Java
  3. S
  4. SQL ResultSet Float Read

Description

The list of methods to do SQL ResultSet Float Read are organized into topic(s).

Method

Float getFloat(ResultSet res, String name)
Returns the values of the specified column as a Float.
float v = res.getFloat(name);
return res.wasNull() ? null : v;
Float getFloat(ResultSet resultSet, int columnIndex)
get Float
float value = resultSet.getFloat(columnIndex);
return resultSet.wasNull() ? null : value;
Float getFloat(ResultSet resultSet, String columnName)
Returns a float value using a given SQL result set and column name.
Float value = null;
if (resultSet != null && columnName != null) {
 float columnValue = resultSet.getFloat(columnName);
 if (!resultSet.wasNull()) {
 value = new Float(columnValue);
return value;
...
Float getFloat(ResultSet rs, String colName)
get Float
float res = rs.getFloat(colName);
return rs.wasNull() ? null : new Float(res);
float getFloat(ResultSet rs, String column)
get a float from ResultSet rs with name 'column'
float i = rs.getFloat(column);
if (rs.wasNull())
 i = 0;
return i;
List getFloatList(ResultSet resultSet, String columnName)
Returns a list of float values using a given SQL result set and column name.
List<Float> values = null;
if (resultSet != null && columnName != null) {
 values = new ArrayList<Float>();
 while (resultSet.next()) {
 values.add(getFloat(resultSet, columnName));
return values;
...
Float getFloatOfNull(ResultSet rs, String columnName)
get Float Of Null
float fVal = rs.getFloat(columnName);
if (rs.wasNull()) {
 return null;
return new Float(fVal);
Float getFloatValue(ResultSet resultSet, int columnIndex)
Return any float value.
float value = resultSet.getFloat(columnIndex);
if (resultSet.wasNull()) {
 return null;
return Float.valueOf(value);


AltStyle によって変換されたページ (->オリジナル) /