Don't forget to allow for values that have commas embedded in them and for blank values, and probably other quirks of csv that I haven't thought of.
There are a number of
java csv parsers available that handle all these things. Try googling 'java csv parser' - it's better than reinventing the wheel.