Changeset 7672


Ignore:
Timestamp:
Mar 21, 2019, 1:37:48 PM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #2161: Import data from Excel files

The ColFunction must assume that it is doing numerical computations unless the value is not possible to parse as a number (this is how it behaved before and the value will be converted later if possible).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/util/parser/ColFunction.java

    r7667 r7672  
    178178    if (column != null && column < data.columns())
    179179    {
    180       if (nextValueType.isNumerical())
    181       {
    182         value = data.getDouble(column, numberFormat, true);
    183       }
    184       else if (nextValueType.isTemporal())
    185       {
    186         value = data.getDate(column, dateFormat, true);
    187       }
    188       else
    189       {
    190         value = data.getString(column);
     180      try
     181      {
     182        value = data.getDouble(column, numberFormat, false);
     183      }
     184      catch (RuntimeException ex)
     185      {
     186        if (nextValueType.isTemporal())
     187        {
     188          value = data.getDate(column, dateFormat, true);
     189        }
     190        else
     191        {
     192          value = data.getString(column);
     193        }
    191194      }
    192195    }
Note: See TracChangeset for help on using the changeset viewer.