I have a java app that does a lot of writes to a mysql database. It's important that data not be lost so if the mysql connection is disrupted and someone shuts down the app, the data in the application's queue is lost.I need to find a way to properly write the queries to a file when the app shuts down, so that next time it starts up I can load the unsaved data and try to process it.The issue is that I can't find a way to view the final sql statement from the \[code\]preparedStatement\[/code\] system, and the data for the queries isn't easy to write to a file because it all comes from a variety of objects.Is there a way to grab the complete query so that I can write it to a file if the db connection is gone?I assume not - is there an alternative other than just building the sql myself?