panchmp / sqlsheet

Automatically exported from code.google.com/p/sqlsheet
Other
27 stars 11 forks source link

java.lang.ArrayIndexOutOfBoundsException: -1 at XlsStreamResultSet.getString(String) #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up a connection to an excel sheet
2. create a prepared statement like "SELECT * FROM ..."
3. call XlsStreamResultSet.getString("[FIRST_COLUMN_NAME]") where 
[FIRST_COLUMN_NAME] is the name of the first column in the excel sheet.

What is the expected output? What do you see instead?
I expect to get the string value from the first column in the current row but I 
get java.lang.ArrayIndexOutOfBoundsException: -1. For other columns the 
received value will be from the column right before.

What version of the product are you using? On what operating system?
6.3

Please provide any additional information below.
The problematic source can be found at XlsStreamResultSet:83
Remove the -1 and it will work.

If you give me commit rights, then I can provide a patch.

Original issue reported on code.google.com by klaus.hauschild.1984@gmail.com on 24 Apr 2013 at 7:01

GoogleCodeExporter commented 9 years ago

Original comment by vasilievip on 27 Apr 2013 at 11:04

GoogleCodeExporter commented 9 years ago
Klaus, you are commiter now, please supply test case with fix

Original comment by vasilievip on 27 Apr 2013 at 11:08

GoogleCodeExporter commented 9 years ago
Could you provide xls file and code? I've just tried in trunk - can't reproduce 
issue

Original comment by vasilievip on 27 Apr 2013 at 12:50

GoogleCodeExporter commented 9 years ago
https://code.google.com/p/sqlsheet/source/detail?r=221

Original comment by vasilievip on 27 Apr 2013 at 1:03

GoogleCodeExporter commented 9 years ago
I think your prepared tescase has the problem, that it misses the first 
ResultSet.next() call.
After adding this call to both variants, the problem occurs.
Then I fixed it.

Original comment by klaus.hauschild.1984@gmail.com on 27 Apr 2013 at 5:41

GoogleCodeExporter commented 9 years ago
Thanks
I'll look into Issue 8 and 9 and then make 6.5 release

Original comment by vasilievip on 27 Apr 2013 at 7:06