8.9.1 Creating an SQLWarning object
If settings are specified in such a manner that warnings that occur during execution of SQL statements are to be retained in the JDBC driver, the JDBC driver generates SQLWarning objects and retains warning information.
You can specify warning retention with sqlwarningkeep in the URL or user property or with the setSQLWarningKeep method.