Statement#getWarnings has shown to be an expensive call. Protect it with a log level check – if nothing would be logged, no reason to call it to begin with.