The problem is that I do not know if the rollback works..
You can use debug statements or logger to track the inserted data.
or if you are using Eclipse IDE, you can mark a breakpoint within
You may use My SQL Workbench to check if all the rows were inserted in the database.
If you want to validate if the rollback occurs, you can insert invalid data.
Is there anywhere a complete example showing how rollback works with prepared statements in a batch?
Its not the combination of batch and rollback that matters here just know the individual concepts. You can find plenty of examples. example1 and example2 will get you started. Looks like execute batch is working fine, if you do not find debug statements in your console