Hello Davide,
With the right tools this works very fine actually. It took me some time to figure out which tool to use, but now I use the well designed and well working "Apache ODF Toolkit" here: https://incubator.apache.org/odftoolkit/
It's still in "incubating mode", but I didn't encounter any grave problems so far.
The ODF Toolkit is relatively small, pure Java bundle consisting of two parts: "ODFDOM" and "Simple API". The first one does the more complex low-level work, while the second ones makes it all very high-level for us normal users.
There's some fine examples on the Apache website, too, which should get you going in a short time. Basically you only need to use the Simple-API in order to open some Opendocument file (Writer, Calc, or the others), then you can insert, modify, delete cells, rows, culumns, paragraphs etc in your .odt or .ods file, and then save the result as file. It's a great tool.
The most recent version is 0.61 (summer 2014) but it needs some external JAR which I couldn't find so far, so I'm using version 0.5 (2013) which contains any needed JARs in one Zip file. Version 0.61's bug fixes and new futures aren't that critical for my purposes yet, but in case you would find out where to get the needed external JAR(s) for the 0.61 version, please tell so! Thanks.
P.S. Just in case your Java programs needs to export the resulting .odt or .ods file to a PDF file, too, I can only recommend to directly call from within Java the Libreoffice executable via Java's ProcessBuilder class, i.e. "libreoffice|soffice--convert-to pdf", but skip the UNO API which didn't work (for me).
Good luck and enjoy your Java programming!
Aurelius