Reading Excel sheet with mixed data types
843854Sep 2 2003 — edited Sep 5 2003This subject has probably been discussed before, but I can't find the answer by searching.
I have to read Microsoft Excel spread sheets with columns that contain mixed data. These columns contain "Item Numbers"; the trouble is that some of these "Numbers" are true integers, while some others are character strings. I'm able to establish a connection and obtain the result set. Then I try reading the data with statements such as:
rs.getString[1];
or
rs.getObject[1];
When the value in the corresponding cell matches the datatype expected by the getXXX method, the statements above return the correct values. Otherwise they return null.
How can I read the values in these cells if I don't know what type of data they contain and I have only one chance to read them?
I hope you can help.
Thanks,
Miguel