OK, so this has nothing to do with POI or Excel, then? It's a question of where between the DB and your
Java code it gets reformatted; is that correct? If so, some strategically placed println statements, or running the code through a debugger, should pinpoint the problem pretty quickly.