Example usage for java.sql SQLWarning getLocalizedMessage

List of usage examples for java.sql SQLWarning getLocalizedMessage

Introduction

In this page you can find the example usage for java.sql SQLWarning getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:org.apache.ddlutils.platform.PlatformImplBase.java

/**
 * Logs any warnings associated to the given connection. Note that the connection needs
 * to be open for this.//from  ww w.  j a va  2  s  . c  o  m
 * 
 * @param connection The open connection
 */
protected void logWarnings(Connection connection) throws SQLException {
    SQLWarning warning = connection.getWarnings();

    while (warning != null) {
        getLog().warn(warning.getLocalizedMessage(), warning.getCause());
        warning = warning.getNextWarning();
    }
}